fix: crud组件代码增加控件是否监听到查询条件改变时自动触发搜索事件
This commit is contained in:
@@ -152,6 +152,7 @@ import dayjs from "dayjs";
|
|||||||
// 定义接收的属性
|
// 定义接收的属性
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
searchConfig: ISearchConfig;
|
searchConfig: ISearchConfig;
|
||||||
|
isOpenAutoSearch: Boolean;
|
||||||
}>();
|
}>();
|
||||||
// 自定义事件
|
// 自定义事件
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -321,7 +322,11 @@ function timeChange(e: any, key: string) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
watch(queryParams, () => {
|
||||||
|
if (props.isOpenAutoSearch) {
|
||||||
|
emit("queryClick", queryParams);
|
||||||
|
}
|
||||||
|
});
|
||||||
// 暴露的属性和方法
|
// 暴露的属性和方法
|
||||||
defineExpose({ getQueryParams, toggleVisible, setQueryValue });
|
defineExpose({ getQueryParams, toggleVisible, setQueryValue });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user