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,6 +137,10 @@
137 paste: { 137 paste: {
138 type: Boolean, 138 type: Boolean,
139 default: false 139 default: false
  140 + },
  141 + disabled: {
  142 + type: Boolean,
  143 + default: false
140 } 144 }
141 }, 145 },
142 data () { 146 data () {
@@ -162,6 +166,7 @@ @@ -162,6 +166,7 @@
162 }, 166 },
163 methods: { 167 methods: {
164 handleClick () { 168 handleClick () {
  169 + if (this.disabled) return;
165 this.$refs.input.click(); 170 this.$refs.input.click();
166 }, 171 },
167 handleChange (e) { 172 handleChange (e) {
@@ -175,9 +180,11 @@ @@ -175,9 +180,11 @@
175 }, 180 },
176 onDrop (e) { 181 onDrop (e) {
177 this.dragOver = false; 182 this.dragOver = false;
  183 + if (this.disabled) return;
178 this.uploadFiles(e.dataTransfer.files); 184 this.uploadFiles(e.dataTransfer.files);
179 }, 185 },
180 handlePaste (e) { 186 handlePaste (e) {
  187 + if (this.disabled) return;
181 if (this.paste) { 188 if (this.paste) {
182 this.uploadFiles(e.clipboardData.files); 189 this.uploadFiles(e.clipboardData.files);
183 } 190 }