优化Link控件下拉数据加载机制
This commit is contained in:
parent
1fea33828b
commit
d390b35a78
@ -186,10 +186,15 @@ function handleInputChange(value: string) {
|
||||
}
|
||||
|
||||
// 处理输入框点击
|
||||
function handleInputClick() {
|
||||
async function handleInputClick() {
|
||||
if (!props.canEdit) return
|
||||
|
||||
// 防止重复调用
|
||||
if (showDropdown.value) return
|
||||
|
||||
// 先加载数据,再显示下拉框
|
||||
await searchOptions(searchQuery.value)
|
||||
showDropdown.value = true
|
||||
searchOptions(searchQuery.value)
|
||||
}
|
||||
|
||||
// 处理选项选择
|
||||
@ -260,7 +265,7 @@ onUnmounted(() => {
|
||||
</label>
|
||||
|
||||
<div class="link-field-container" @mouseenter="showLinkButtons" @mouseleave="hideLinkButtons">
|
||||
<div class="input-wrapper" @click="handleInputClick">
|
||||
<div class="input-wrapper">
|
||||
<n-input
|
||||
:value="hasValue ? displayValue : searchQuery"
|
||||
:placeholder="ctx.t(df.fieldname)"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user