fix singleMode click
parent
1d214aafe5
commit
83d6ab3ed2
|
@ -563,7 +563,11 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
getLabelFromOption (child) {
|
getLabelFromOption (child) {
|
||||||
return getPropValue(child, this.optionLabelProp)
|
let label = getPropValue(child, this.optionLabelProp)
|
||||||
|
if (Array.isArray(label) && label.length === 1 && !label[0].tag) {
|
||||||
|
label = label[0].text
|
||||||
|
}
|
||||||
|
return label
|
||||||
},
|
},
|
||||||
|
|
||||||
getLabelFromProps (value) {
|
getLabelFromProps (value) {
|
||||||
|
@ -1251,11 +1255,12 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const singleValue = sValue[0]
|
const singleValue = sValue[0]
|
||||||
|
const key = singleValue.key
|
||||||
selectedValue = (
|
selectedValue = (
|
||||||
<div
|
<div
|
||||||
key='value'
|
key='value'
|
||||||
class={`${prefixCls}-selection-selected-value`}
|
class={`${prefixCls}-selection-selected-value`}
|
||||||
title={singleValue.title || singleValue.label}
|
title={this.titleMap.get(key) || this.labelMap.get(key)}
|
||||||
style={{
|
style={{
|
||||||
display: showSelectedValue ? 'block' : 'none',
|
display: showSelectedValue ? 'block' : 'none',
|
||||||
opacity,
|
opacity,
|
||||||
|
@ -1373,14 +1378,14 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div class={className} ref='topCtrlRef' onClick={this.muitipleContainerClick}>
|
<div class={className} ref='topCtrlRef' onClick={this.topCtrlContainerClick}>
|
||||||
{this.getPlaceholderElement()}
|
{this.getPlaceholderElement()}
|
||||||
{innerNode}
|
{innerNode}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
muitipleContainerClick (e) {
|
topCtrlContainerClick (e) {
|
||||||
if (this.openStatus) {
|
if (this.openStatus && !isSingleMode(this.$props)) {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue