mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-17 10:27:30 +08:00
e355341596
集成 Pinia 状态管理
23 lines
439 B
TypeScript
23 lines
439 B
TypeScript
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
|
|
};
|
|
});
|