Files
AlgerMusicPlayer/src/store/index.ts
T

48 lines
810 B
TypeScript
Raw Normal View History

import { createStore } from "vuex";
2021-07-20 22:46:18 +08:00
import { SongResult } from "@/type/music";
let state = {
menus: [
{
href: "/",
icon: "icon-homefill",
text: "hello",
},
{
href: "/main",
icon: "icon-peoplefill",
text: "hello",
},
{
href: "/",
icon: "icon-videofill",
text: "hello",
},
],
2021-07-20 22:46:18 +08:00
isPlay: false,
playMusic: {} as SongResult,
};
2021-07-20 22:46:18 +08:00
let mutations = {
setMenus(state: any, menus: any[]) {
state.menus = menus;
},
setPlay(state: any, playMusic: SongResult) {
console.log(playMusic);
state.playMusic = playMusic;
},
setIsPlay(state: any, isPlay: boolean) {
console.log(isPlay);
state.isPlay = isPlay;
},
};
const store = createStore({
state: state,
mutations: mutations,
});
export default store;