Update input.vue
This commit is contained in:
parent
17ea524470
commit
448394ac4b
1 changed files with 20 additions and 13 deletions
|
@ -178,16 +178,32 @@
|
||||||
return {
|
return {
|
||||||
currentValue: this.value,
|
currentValue: this.value,
|
||||||
prefixCls: prefixCls,
|
prefixCls: prefixCls,
|
||||||
prepend: true,
|
|
||||||
append: true,
|
|
||||||
slotReady: false,
|
slotReady: false,
|
||||||
textareaStyles: {},
|
textareaStyles: {},
|
||||||
showPrefix: false,
|
|
||||||
showSuffix: false,
|
|
||||||
isOnComposition: false
|
isOnComposition: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
prepend () {
|
||||||
|
let state = false;
|
||||||
|
if (this.type !== 'textarea') state = this.$slots.prepend !== undefined;
|
||||||
|
return state;
|
||||||
|
},
|
||||||
|
append () {
|
||||||
|
let state = false;
|
||||||
|
if (this.type !== 'textarea') state = this.$slots.append !== undefined;
|
||||||
|
return state;
|
||||||
|
},
|
||||||
|
showPrefix () {
|
||||||
|
let state = false;
|
||||||
|
if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined;
|
||||||
|
return state;
|
||||||
|
},
|
||||||
|
showSuffix () {
|
||||||
|
let state = false;
|
||||||
|
if (this.type !== 'textarea') state = this.suffix !== '' || this.$slots.suffix !== undefined;
|
||||||
|
return state;
|
||||||
|
},
|
||||||
wrapClasses () {
|
wrapClasses () {
|
||||||
return [
|
return [
|
||||||
`${prefixCls}-wrapper`,
|
`${prefixCls}-wrapper`,
|
||||||
|
@ -324,15 +340,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
if (this.type !== 'textarea') {
|
|
||||||
this.prepend = this.$slots.prepend !== undefined;
|
|
||||||
this.append = this.$slots.append !== undefined;
|
|
||||||
this.showPrefix = this.prefix !== '' || this.$slots.prefix !== undefined;
|
|
||||||
this.showSuffix = this.suffix !== '' || this.$slots.suffix !== undefined;
|
|
||||||
} else {
|
|
||||||
this.prepend = false;
|
|
||||||
this.append = false;
|
|
||||||
}
|
|
||||||
this.slotReady = true;
|
this.slotReady = true;
|
||||||
this.resizeTextarea();
|
this.resizeTextarea();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue