🦄 refactor: 重构代码将 Vuex替换为 Pinia

集成 Pinia 状态管理
This commit is contained in:
alger
2025-03-19 22:48:28 +08:00
parent 4fa5ed0ca6
commit e355341596
40 changed files with 1170 additions and 494 deletions
+22
View File
@@ -0,0 +1,22 @@
import { defineStore } from 'pinia';
import { ref } from 'vue';
export const useSearchStore = defineStore('search', () => {
const searchValue = ref('');
const searchType = ref(1);
const setSearchValue = (value: string) => {
searchValue.value = value;
};
const setSearchType = (type: number) => {
searchType.value = type;
};
return {
searchValue,
searchType,
setSearchValue,
setSearchType
};
});