yc-ui2 0.1.0-beta5 → 0.1.0-beta6
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/packages/index.js +23 -0
package/package.json
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
import YcSlideVerify from 'comp/YcSlideVerify/index.vue'
|
2
|
+
|
3
|
+
|
4
|
+
const components = [
|
5
|
+
YcSlideVerify
|
6
|
+
]
|
7
|
+
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
8
|
+
const install = function (Vue) {
|
9
|
+
// 遍历注册全局组件
|
10
|
+
components.forEach(component => {
|
11
|
+
Vue.component(component.name, component)
|
12
|
+
})
|
13
|
+
|
14
|
+
// 判断是否是直接引入文件,如果是,就不用调用 Vue.use()
|
15
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
16
|
+
install(window.Vue)
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
|
21
|
+
export default {
|
22
|
+
install
|
23
|
+
}
|