diff --git a/sheep/store/app.js b/sheep/store/app.js index 262adde9..969738c8 100644 --- a/sheep/store/app.js +++ b/sheep/store/app.js @@ -8,8 +8,7 @@ import user from './user'; import sys from './sys'; import { baseUrl, h5Url } from '@/sheep/config'; -const app = defineStore({ - id: 'app', +const app = defineStore('app', { state: () => ({ paramsForTabbar: {}, // 为全局tabbar跳转传参用。原因是 tabbar 无法传参,只能通过全局状态传递 info: { diff --git a/sheep/store/cart.js b/sheep/store/cart.js index ab96a2bc..748fb554 100644 --- a/sheep/store/cart.js +++ b/sheep/store/cart.js @@ -1,8 +1,7 @@ import { defineStore } from 'pinia'; import CartApi from '@/sheep/api/trade/cart'; -const cart = defineStore({ - id: 'cart', +const cart = defineStore('cart', { state: () => ({ list: [], // 购物车列表(invalidList + validList) selectedIds: [], // 已选列表 diff --git a/sheep/store/modal.js b/sheep/store/modal.js index bde9e0a3..c1764386 100644 --- a/sheep/store/modal.js +++ b/sheep/store/modal.js @@ -1,7 +1,6 @@ import { defineStore } from 'pinia'; -const modal = defineStore({ - id: 'modal', +const modal = defineStore('modal', { state: () => ({ auth: '', // 授权弹框 accountLogin|smsLogin|resetPassword|changeMobile|changePassword|changeUsername share: false, // 分享弹框 diff --git a/sheep/store/sys.js b/sheep/store/sys.js index f7151e0a..915b8f88 100644 --- a/sheep/store/sys.js +++ b/sheep/store/sys.js @@ -1,8 +1,7 @@ import { defineStore } from 'pinia'; import app from './app'; -const sys = defineStore({ - id: 'sys', +const sys = defineStore('sys', { state: () => ({ theme: '', // 主题, mode: 'light', // 明亮模式、暗黑模式(暂未支持) diff --git a/sheep/store/user.js b/sheep/store/user.js index fceb584f..d2be5175 100644 --- a/sheep/store/user.js +++ b/sheep/store/user.js @@ -36,8 +36,7 @@ const defaultNumData = { }, }; -const user = defineStore({ - id: 'user', +const user = defineStore('user', { state: () => ({ userInfo: clone(defaultUserInfo), // 用户信息 userWallet: clone(defaultUserWallet), // 用户钱包信息