Commit cb7b6483 authored by 郭铭瑶's avatar 郭铭瑶 🤘

update readme

parent 6c0a0a1e
......@@ -15,21 +15,13 @@
3. 在大屏项目中引入使用:
```javascript
import fetchComponents from 'http://127.0.0.1:8080/component-lib.min.js' // 假设打包文件放在http://127.0.0.1:8080上
import * as vue from 'vue'
import fetchComponents from 'http://127.0.0.1:8080/component-lib.min.js' // 假设打包文件放在http://127.0.0.1:8080上
// 需要和大屏共用一个vue,因此将vue作为参数传入
// 第二个参数为请求数据地址
const { A001, A002, A003, A004, A005, A006 } = fetchComponents(vue)(
'http://127.0.0.1:8082',
)
export default {
A001,
A002,
A003,
A004,
A005,
A006,
}
const { components, eventBus } = fetchComponents(vue)('http://127.0.0.1:8082')
export default components // 暴露出组件
export const bus = eventBus // 暴露出组件的事件总线
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment