| 1234567891011121314151617 |
- import {defineStore} from "pinia";
- // defineStore 调用后返回一个函数,调用该函数获得 Store 实体
- export const useSysStore = defineStore({
- // id: 必须的,在所有 Store 中唯一
- id: "sys_store",
- // state: 返回对象的函数
- state: () => ({
- // 是否运行在后台
- show: false
- }),
- actions: {
- setShow(show: boolean): void {
- this.show = show;
- }
- },
- });
|