Select: Option add new prop: tag

This commit is contained in:
梁灏 2019-09-09 10:24:04 +08:00
parent 81395eca7d
commit 616c19f5be
2 changed files with 7 additions and 1 deletions

View file

@ -34,6 +34,10 @@
isFocused: {
type: Boolean,
default: false
},
// 4.0.0
tag: {
type: [String, Number]
}
},
data () {
@ -67,10 +71,12 @@
this.dispatch('iSelect', 'on-select-selected', {
value: this.value,
label: this.optionLabel,
tag: this.tag
});
this.$emit('on-select-selected', {
value: this.value,
label: this.optionLabel,
tag: this.tag
});
},
},

View file

@ -9,7 +9,7 @@
class="ivu-tag ivu-tag-checked"
v-for="(item, index) in selectedMultiple"
v-if="maxTagCount === undefined || index < maxTagCount">
<span class="ivu-tag-text">{{ item.label }}</span>
<span class="ivu-tag-text">{{ item.tag !== undefined ? item.tag : item.label }}</span>
<Icon type="ios-close" @click.native.stop="removeTag(item)"></Icon>
</div><div class="ivu-tag ivu-tag-checked" v-if="maxTagCount !== undefined && selectedMultiple.length > maxTagCount">
<span class="ivu-tag-text ivu-select-max-tag">