mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-02-17 13:20:52 +08:00
fix(select): can't control menu open status by v-model
This commit is contained in:
parent
aa963a29e5
commit
1c0343c5d9
@ -38,12 +38,12 @@ export default defineComponent({
|
||||
return {
|
||||
trim: (value: string): SelectOption => {
|
||||
return {
|
||||
label: value.slice(0, 2),
|
||||
label: value.split(' ')[0],
|
||||
value
|
||||
}
|
||||
},
|
||||
singleValue: ref('一个不知哪里来的值'),
|
||||
multipleValue: ref(['一个不知哪里来的值', '两个不知哪里来的值']),
|
||||
singleValue: ref('A Nowhere Value'),
|
||||
multipleValue: ref(['First Nowhere Value', 'Second Nowhere Value']),
|
||||
options: [
|
||||
{
|
||||
label: "Everybody's Got Something to Hide Except Me and My Monkey",
|
||||
|
@ -421,11 +421,19 @@ export default defineComponent({
|
||||
function handleTriggerClick (): void {
|
||||
if (mergedDisabledRef.value) return
|
||||
if (!mergedShowRef.value) {
|
||||
if (!forceHideMenuRef.value) {
|
||||
if (!props.filterable) {
|
||||
openMenu()
|
||||
} else {
|
||||
if (props.filterable) {
|
||||
focusSelectionInput()
|
||||
if (!forceHideMenuRef.value) {
|
||||
void nextTick(() => {
|
||||
if (mergedShowRef.value) {
|
||||
openMenu()
|
||||
} else {
|
||||
focusSelectionInput()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
openMenu()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user