mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 23:57:22 +08:00
🦄 refactor: 重构代码将 Vuex替换为 Pinia
集成 Pinia 状态管理
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
|
||||
import homeRouter from '@/router/home';
|
||||
|
||||
export const useMenuStore = defineStore('menu', () => {
|
||||
const menus = ref(homeRouter);
|
||||
|
||||
const setMenus = (newMenus: any[]) => {
|
||||
menus.value = newMenus;
|
||||
};
|
||||
|
||||
return {
|
||||
menus,
|
||||
setMenus
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user