afn-basic-components 1.1.0 → 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/src/styles/sidebar.scss +8 -6
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
|
+
};
|
package/src/styles/sidebar.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@import "./variables.scss";
|
|
2
|
+
|
|
1
3
|
#app {
|
|
2
4
|
.main-container {
|
|
3
5
|
min-height: 100%;
|
|
@@ -114,7 +116,7 @@
|
|
|
114
116
|
.el-submenu {
|
|
115
117
|
overflow: hidden;
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
& > .el-submenu__title {
|
|
118
120
|
padding: 0 !important;
|
|
119
121
|
|
|
120
122
|
.svg-icon {
|
|
@@ -133,8 +135,8 @@
|
|
|
133
135
|
|
|
134
136
|
.el-menu--collapse {
|
|
135
137
|
.el-submenu {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
+
& > .el-submenu__title {
|
|
139
|
+
& > span {
|
|
138
140
|
height: 0;
|
|
139
141
|
width: 0;
|
|
140
142
|
overflow: hidden;
|
|
@@ -151,7 +153,7 @@
|
|
|
151
153
|
|
|
152
154
|
.el-menu-item,
|
|
153
155
|
.el-submenu__title {
|
|
154
|
-
|
|
156
|
+
& > span {
|
|
155
157
|
height: 0;
|
|
156
158
|
width: 0;
|
|
157
159
|
overflow: hidden;
|
|
@@ -171,7 +173,7 @@
|
|
|
171
173
|
|
|
172
174
|
// when menu collapsed
|
|
173
175
|
.el-menu--vertical {
|
|
174
|
-
|
|
176
|
+
& > .el-menu {
|
|
175
177
|
.svg-icon {
|
|
176
178
|
margin-right: 16px;
|
|
177
179
|
}
|
|
@@ -182,7 +184,7 @@
|
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
|
|
185
|
-
.nest-menu .el-submenu
|
|
187
|
+
.nest-menu .el-submenu > .el-submenu__title,
|
|
186
188
|
.el-menu-item {
|
|
187
189
|
&:hover {
|
|
188
190
|
// you can use $subMenuHover
|