xianniu-ui 0.4.1 → 0.4.3
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/lib/style/index.css +1 -1
- package/lib/style/upload.css +1 -1
- package/lib/xianniu-ui.common.js +25 -23
- package/lib/xianniu-ui.umd.js +25 -23
- package/lib/xianniu-ui.umd.min.js +2 -2
- package/package.json +1 -1
- package/packages/style/src/upload.scss +11 -5
- package/packages/upload/main.vue +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
.xn-upload {
|
|
2
|
+
&.is-hidden {
|
|
3
|
+
.el-upload {
|
|
4
|
+
&.el-upload--picture-card {
|
|
5
|
+
display: none;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
2
9
|
&-list__item {
|
|
3
|
-
|
|
4
10
|
&-file {
|
|
5
11
|
height: 100%;
|
|
6
12
|
display: flex;
|
|
@@ -53,10 +59,10 @@
|
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
61
|
// &-main {
|
|
56
|
-
|
|
62
|
+
|
|
57
63
|
// }
|
|
58
|
-
.el-upload-list{
|
|
59
|
-
&.el-upload-list--picture-card{
|
|
64
|
+
.el-upload-list {
|
|
65
|
+
&.el-upload-list--picture-card {
|
|
60
66
|
.el-upload-list__item {
|
|
61
67
|
width: 80px;
|
|
62
68
|
height: 80px;
|
|
@@ -82,7 +88,7 @@
|
|
|
82
88
|
.upload-limit {
|
|
83
89
|
width: inherit;
|
|
84
90
|
height: inherit;
|
|
85
|
-
i{
|
|
91
|
+
i {
|
|
86
92
|
font-size: 20px;
|
|
87
93
|
}
|
|
88
94
|
}
|
package/packages/upload/main.vue
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
ref="upload"
|
|
4
4
|
:class="{
|
|
5
5
|
'is-disabled': $attrs.disabled != undefined,
|
|
6
|
+
'is-hidden': preview
|
|
6
7
|
}"
|
|
7
8
|
class="xn-upload xn-upload-main"
|
|
8
9
|
action="###"
|
|
@@ -132,7 +133,7 @@ export default {
|
|
|
132
133
|
default: "",
|
|
133
134
|
},
|
|
134
135
|
accept: {
|
|
135
|
-
type: Array,
|
|
136
|
+
type: [Array,String],
|
|
136
137
|
default: () => ["jpg", "jpeg", "png", "pdf"],
|
|
137
138
|
},
|
|
138
139
|
maxSize: {
|
|
@@ -203,7 +204,7 @@ export default {
|
|
|
203
204
|
// 判断上传格式
|
|
204
205
|
fileExt = `${fileExt}`.toLowerCase();
|
|
205
206
|
|
|
206
|
-
if (!this.accept.includes(fileExt)) {
|
|
207
|
+
if (!this.accept.includes(fileExt) && this.accept !== '*') {
|
|
207
208
|
this.$message.warning(`请上传指定格式【${this.accept}】`);
|
|
208
209
|
return false;
|
|
209
210
|
}
|