feat(Form): add input-align prop

This commit is contained in:
陈嘉涵
2020-02-13 16:25:42 +08:00
parent 2d64458776
commit 7a9d1d7ab6
5 changed files with 12 additions and 8 deletions
+7 -6
View File
@@ -326,18 +326,17 @@ export default createComponent({
genInput() {
const { type } = this;
const inputSlot = this.slots('input');
const inputAlign = this.getProp('inputAlign');
if (inputSlot) {
return (
<div class={bem('control', [this.inputAlign, 'custom'])}>
{inputSlot}
</div>
<div class={bem('control', [inputAlign, 'custom'])}>{inputSlot}</div>
);
}
const inputProps = {
ref: 'input',
class: bem('control', this.inputAlign),
class: bem('control', inputAlign),
domProps: {
value: this.value,
},
@@ -435,11 +434,13 @@ export default createComponent({
},
getProp(key) {
if (isDef(this[key])) {
return this[key];
}
if (this.vanForm && isDef(this.vanForm[key])) {
return this.vanForm[key];
}
return this[key];
},
},