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