Form add hide-required-mark prop

This commit is contained in:
梁灏 2019-09-16 10:26:49 +08:00
parent 738c852458
commit 66e8d1cb7b
2 changed files with 13 additions and 1 deletions

View file

@ -37,6 +37,11 @@
return oneOf(value, ['on', 'off']); return oneOf(value, ['on', 'off']);
}, },
default: 'off' default: 'off'
},
// 4.0.0
hideRequiredMark: {
type: Boolean,
default: false
} }
}, },
provide() { provide() {
@ -53,7 +58,8 @@
`${prefixCls}`, `${prefixCls}`,
`${prefixCls}-label-${this.labelPosition}`, `${prefixCls}-label-${this.labelPosition}`,
{ {
[`${prefixCls}-inline`]: this.inline [`${prefixCls}-inline`]: this.inline,
[`${prefixCls}-hide-required-mark`]: this.hideRequiredMark
} }
]; ];
} }

View file

@ -69,3 +69,9 @@
// todo // todo
} }
} }
.@{form-prefix-cls}-hide-required-mark .@{form-item-prefix-cls}-required{
.@{form-item-prefix-cls}-label:before {
display: none;
}
}