34 lines
530 B
JavaScript
34 lines
530 B
JavaScript
|
|
import { defineStore } from 'pinia'
|
|||
|
|
|
|||
|
|
export const useStoreUserData = defineStore('userData', {
|
|||
|
|
state: () => {
|
|||
|
|
return {
|
|||
|
|
// 用户信息
|
|||
|
|
userInfo: {},
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
|
|||
|
|
import { useStore } from '../../../store/wikiDisplay.js'
|
|||
|
|
let store = useStore();
|
|||
|
|
|
|||
|
|
订阅变化:
|
|||
|
|
store.$subscribe((mutation, state) => {
|
|||
|
|
if (mutation.events.key === 'xxx') {
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
修改:
|
|||
|
|
const commentChange = () => {
|
|||
|
|
store.commentShow = !store.commentShow;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
计算属性:
|
|||
|
|
|
|||
|
|
let commentShow = computed(() => store.commentShow);
|
|||
|
|
|
|||
|
|
*/
|