update 优化 重构抽出一些常用hooks组件简化页面编码
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export function useSearchToggle(initialValue = true) {
|
||||
const showSearch = ref(initialValue);
|
||||
|
||||
const toggleSearch = () => {
|
||||
showSearch.value = !showSearch.value;
|
||||
};
|
||||
|
||||
const setShowSearch = (value: boolean) => {
|
||||
showSearch.value = value;
|
||||
};
|
||||
|
||||
return {
|
||||
showSearch,
|
||||
toggleSearch,
|
||||
setShowSearch
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user