fix: 暂存

pull/26/head
lizijiee 1 year ago
parent 35cb522488
commit 0023764a99

@ -32,6 +32,9 @@ function collapseHandler() {
} }
const mousetrap = inject('mousetrap') as any const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler) mousetrap.bind('[', collapseHandler)
const searchKeyword = ref('')
const asideWidth = computed(() => { const asideWidth = computed(() => {
return collapse.value ? 0 : 308; return collapse.value ? 0 : 308;
}); });
@ -136,11 +139,15 @@ const showSearch = ref(false);
function setShowSearch(value: boolean) { function setShowSearch(value: boolean) {
showSearch.value = value; showSearch.value = value;
if (value === false) {
if (value === false) (packageListRef.value as any).search(""); (packageListRef.value as any).search("");
searchKeyword.value = ''
};
} }
const inputHandler = debounce((word) => { const inputHandler = debounce((word) => {
searchKeyword.value = word
console.log(22222)
(packageListRef.value as any).search(word); (packageListRef.value as any).search(word);
}, 500); }, 500);
</script> </script>
@ -183,6 +190,7 @@ const inputHandler = debounce((word) => {
style="flex: 1; height: 32px" style="flex: 1; height: 32px"
placeholder="请输入你需要搜索的内容" placeholder="请输入你需要搜索的内容"
@input="inputHandler" @input="inputHandler"
v-model:value="searchKeyword"
> >
<template #suffix> <template #suffix>
<SvgIcon size="14px" name="magnifying-1" /> <SvgIcon size="14px" name="magnifying-1" />

Loading…
Cancel
Save