Commit a367d3e49a4f3b543718e0a85dbc4b4c3639b28a

Authored by 梁灏
1 parent 1d5d6ef6

fixed #5171

Showing 1 changed file with 7 additions and 0 deletions   Show diff stats
src/components/upload/upload.vue
... ... @@ -137,6 +137,10 @@
137 137 paste: {
138 138 type: Boolean,
139 139 default: false
  140 + },
  141 + disabled: {
  142 + type: Boolean,
  143 + default: false
140 144 }
141 145 },
142 146 data () {
... ... @@ -162,6 +166,7 @@
162 166 },
163 167 methods: {
164 168 handleClick () {
  169 + if (this.disabled) return;
165 170 this.$refs.input.click();
166 171 },
167 172 handleChange (e) {
... ... @@ -175,9 +180,11 @@
175 180 },
176 181 onDrop (e) {
177 182 this.dragOver = false;
  183 + if (this.disabled) return;
178 184 this.uploadFiles(e.dataTransfer.files);
179 185 },
180 186 handlePaste (e) {
  187 + if (this.disabled) return;
181 188 if (this.paste) {
182 189 this.uploadFiles(e.clipboardData.files);
183 190 }
... ...