[breaking change] Field: renaming icon props、events

This commit is contained in:
陈嘉涵
2019-04-29 14:49:30 +08:00
parent 1c5c5eaf73
commit 706f047909
4 changed files with 9 additions and 33 deletions
+2 -6
View File
@@ -20,7 +20,6 @@ export default sfc({
labelWidth: [String, Number],
labelAlign: String,
inputAlign: String,
onIconClick: Function,
autosize: [Boolean, Object],
errorMessage: String,
errorMessageAlign: String,
@@ -130,10 +129,7 @@ export default sfc({
},
onClickRightIcon() {
// compatible old version
this.$emit('click-icon');
this.$emit('click-right-icon');
this.onIconClick && this.onIconClick();
},
onClear(event) {
@@ -220,11 +216,11 @@ export default sfc({
renderRightIcon() {
const { slots } = this;
const showRightIcon = slots('right-icon') || slots('icon') || this.rightIcon || this.icon;
const showRightIcon = slots('right-icon') || this.rightIcon;
if (showRightIcon) {
return (
<div class={bem('right-icon')} onClick={this.onClickRightIcon}>
{slots('right-icon') || slots('icon') || <Icon name={this.rightIcon || this.icon} />}
{slots('right-icon') || <Icon name={this.rightIcon} />}
</div>
);
}