main.js 945 Bytes
/*
 * @Date: 2022-04-18 15:59:42
 * @LastEditors: hookehuyr hookehuyr@gmail.com
 * @LastEditTime: 2024-01-30 15:26:30
 * @FilePath: /xyxBooking-weapp/src/stores/main.js
 * @Description: 文件描述
 */
import { defineStore } from 'pinia';

export const mainStore = defineStore('main', {
  state: () => {
    return {
      msg: 'Hello world',
      count: 0,
      auth: false,
      // keepPages: ['default'], // 小程序不支持这种 keep-alive 机制
      appUserInfo: [], // 缓存预约人信息
    };
  },
  getters: {
    // getKeepPages () {
    //   return this.keepPages
    // },
  },
  actions: {
    changeState (state) {
      this.auth = state;
    },
    // changeKeepPages () {
    //   this.keepPages = ['default'];
    // },
    // keepThisPage () {
    //   // 小程序路由缓存由框架控制
    // },
    // removeThisPage () {
    // },
    changeUserInfo (info) {
      this.appUserInfo = info;
    }
  },
});