[新增] select组件新增search事件,用于触发远程搜索或自定义搜索逻辑

This commit is contained in:
castleiMac
2022-04-03 17:33:20 +08:00
parent 49f5997934
commit 1cdfa5d112
2 changed files with 33 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ const open = function () {
openState.value = !openState.value;
};
const emit = defineEmits(["update:modelValue", "change"]);
const emit = defineEmits(["update:modelValue", "change", 'search']);
const selectItem = ref<SelectItem>({
value: !props.multiple
? props.modelValue
@@ -101,6 +101,7 @@ const input = ref(false)
const value = computed({
set(v: any) {
txt.value = v;
emit('search', v)
},
get() {
if (input.value) {