Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
C
component-lib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郭铭瑶
component-lib
Commits
cb7b6483
Commit
cb7b6483
authored
Oct 18, 2021
by
郭铭瑶
🤘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update readme
parent
6c0a0a1e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
README.md
README.md
+5
-13
No files found.
README.md
View file @
cb7b6483
...
@@ -15,21 +15,13 @@
...
@@ -15,21 +15,13 @@
3.
在大屏项目中引入使用:
3.
在大屏项目中引入使用:
```
javascript
```
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
*
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作为参数传入
// 需要和大屏共用一个vue,因此将vue作为参数传入
// 第二个参数为请求数据地址
// 第二个参数为请求数据地址
const
{
A001
,
A002
,
A003
,
A004
,
A005
,
A006
}
=
fetchComponents
(
vue
)(
const
{
components
,
eventBus
}
=
fetchComponents
(
vue
)(
'http://127.0.0.1:8082'
)
'http://127.0.0.1:8082'
,
)
export
default
components
// 暴露出组件
export
const
bus
=
eventBus
// 暴露出组件的事件总线
export
default
{
A001
,
A002
,
A003
,
A004
,
A005
,
A006
,
}
```
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment