yc-ui2 0.1.0-beta5 → 0.1.0-beta6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yc-ui2",
3
- "version": "0.1.0-beta5",
3
+ "version": "0.1.0-beta6",
4
4
  "private": false,
5
5
  "description": "测试阶段",
6
6
  "main": "dist/yc-ui2.umd.min.js",
@@ -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
+ }