Upload support Form's disabled
This commit is contained in:
parent
6e22b4d1ff
commit
834b31f731
1 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue