Upload support Form's disabled

This commit is contained in:
梁灏 2019-09-16 22:11:38 +08:00
parent 6e22b4d1ff
commit 834b31f731

View file

@ -29,12 +29,13 @@
import ajax from './ajax';
import { oneOf } from '../../utils/assist';
import Emitter from '../../mixins/emitter';
import mixinsForm from '../../mixins/form';
const prefixCls = 'ivu-upload';
export default {
name: 'Upload',
mixins: [ Emitter ],
mixins: [ Emitter, mixinsForm ],
components: { UploadList },
props: {
action: {
@ -166,7 +167,7 @@
},
methods: {
handleClick () {
if (this.disabled) return;
if (this.itemDisabled) return;
this.$refs.input.click();
},
handleChange (e) {
@ -180,11 +181,11 @@
},
onDrop (e) {
this.dragOver = false;
if (this.disabled) return;
if (this.itemDisabled) return;
this.uploadFiles(e.dataTransfer.files);
},
handlePaste (e) {
if (this.disabled) return;
if (this.itemDisabled) return;
if (this.paste) {
this.uploadFiles(e.clipboardData.files);
}