fix Select bug that multiple options disalbed
This commit is contained in:
parent
df671ae8c3
commit
b15d9455cc
3 changed files with 17 additions and 2 deletions
|
@ -9,8 +9,8 @@
|
|||
class="ivu-tag ivu-tag-checked"
|
||||
v-for="(item, index) in selectedMultiple"
|
||||
v-if="maxTagCount === undefined || index < maxTagCount">
|
||||
<span class="ivu-tag-text">{{ item.tag !== undefined ? item.tag : item.label }}</span>
|
||||
<Icon type="ios-close" @click.native.stop="removeTag(item)"></Icon>
|
||||
<span class="ivu-tag-text" :class="{ 'ivu-select-multiple-tag-hidden': item.disabled }">{{ item.tag !== undefined ? item.tag : item.label }}</span>
|
||||
<Icon type="ios-close" v-if="!item.disabled" @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">
|
||||
<template v-if="maxTagPlaceholder">{{ maxTagPlaceholder(selectedMultiple.length - maxTagCount) }}</template>
|
||||
|
|
|
@ -490,9 +490,12 @@
|
|||
const option = this.flatOptions.find(({componentOptions}) => componentOptions.propsData.value === value);
|
||||
if (!option) return null;
|
||||
const label = getOptionLabel(option);
|
||||
// 修复多选时,选项有disabled属性,选中项仍然能删除的 bug
|
||||
const disabled = option.componentOptions.propsData.disabled;
|
||||
return {
|
||||
value: value,
|
||||
label: label,
|
||||
disabled: disabled
|
||||
};
|
||||
},
|
||||
getInitialValue(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue