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