afn-basic-components 1.1.1 → 1.1.2
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 +1 -1
- package/src/index.js +22 -32
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,50 +1,40 @@
|
|
|
1
1
|
// 导入组件
|
|
2
|
-
import GlobalDrawer from
|
|
3
|
-
import MessagePopUp from
|
|
4
|
-
import ProTable from
|
|
2
|
+
import GlobalDrawer from "./components/GlobalDrawer/index.vue";
|
|
3
|
+
import MessagePopUp from "./components/MessagePopUp/index.vue";
|
|
4
|
+
import ProTable from "./components/ProTable/index.vue";
|
|
5
5
|
|
|
6
6
|
// 导入样式
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import './styles/transition.scss'
|
|
14
|
-
import './styles/utils.scss'
|
|
7
|
+
import "./styles/variables.scss";
|
|
8
|
+
import "./styles/btn.scss";
|
|
9
|
+
import "./styles/element-ui.scss";
|
|
10
|
+
import "./styles/index.scss";
|
|
11
|
+
import "./styles/sidebar.scss";
|
|
12
|
+
import "./styles/transition.scss";
|
|
15
13
|
|
|
16
14
|
// 组件列表
|
|
17
|
-
const components = [
|
|
18
|
-
GlobalDrawer,
|
|
19
|
-
MessagePopUp,
|
|
20
|
-
ProTable
|
|
21
|
-
]
|
|
15
|
+
const components = [GlobalDrawer, MessagePopUp, ProTable];
|
|
22
16
|
|
|
23
17
|
// 定义 install 方法,接收 Vue 作为参数
|
|
24
|
-
const install = function(Vue) {
|
|
18
|
+
const install = function (Vue) {
|
|
25
19
|
// 判断是否安装
|
|
26
|
-
if (install.installed) return
|
|
27
|
-
install.installed = true
|
|
20
|
+
if (install.installed) return;
|
|
21
|
+
install.installed = true;
|
|
28
22
|
|
|
29
23
|
// 遍历注册所有组件
|
|
30
|
-
components.forEach(component => {
|
|
31
|
-
Vue.component(component.name, component)
|
|
32
|
-
})
|
|
33
|
-
}
|
|
24
|
+
components.forEach((component) => {
|
|
25
|
+
Vue.component(component.name, component);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
34
28
|
|
|
35
29
|
// 判断是否是直接引入文件,如果是,就不用调用 Vue.use()
|
|
36
|
-
if (typeof window !==
|
|
37
|
-
install(window.Vue)
|
|
30
|
+
if (typeof window !== "undefined" && window.Vue) {
|
|
31
|
+
install(window.Vue);
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
// 导出组件
|
|
41
|
-
export {
|
|
42
|
-
GlobalDrawer,
|
|
43
|
-
MessagePopUp,
|
|
44
|
-
ProTable
|
|
45
|
-
}
|
|
35
|
+
export { GlobalDrawer, MessagePopUp, ProTable };
|
|
46
36
|
|
|
47
37
|
// 导出 install 方法
|
|
48
38
|
export default {
|
|
49
|
-
install
|
|
50
|
-
}
|
|
39
|
+
install,
|
|
40
|
+
};
|