123456789101112131415161718 |
- import { defineStore } from 'pinia'
- export const useStore = defineStore('home', {
- // 相当于data
- state: () => {
- return {
- // 原始数据
- dataAll: {} as any,
- mode: {} as any,
- currentInfoPart: {} as any,
- lastCode: '' as any ,
- }
- },
- // 相当于计算属性
- getters: {},
- // 相当于vuex的 mutation + action,可以同时写同步和异步的代码
- actions: {}
- })
|