This commit is contained in:
Viet An
2026-05-14 09:11:18 +07:00
parent 336c8c9036
commit 4d37397ee4
25 changed files with 450 additions and 209 deletions

View File

@@ -4,7 +4,6 @@ export const useStore = defineStore("maindev", {
state: () => ({
viewport: undefined,
login: undefined,
dealer: undefined,
token: undefined,
common: undefined,
settings: [],
@@ -18,15 +17,13 @@ export const useStore = defineStore("maindev", {
branch: {},
rights: [],
product: [],
cart: [],
}),
actions: {
commit(name, data) {
// if (name === "common") {
// console.trace("commit", name, data);
// }
// console.trace("commit", name, data);
this[name] = data;
},
removeSnackbar() {
this.snackbar = undefined;
},
@@ -35,10 +32,6 @@ export const useStore = defineStore("maindev", {
this.product = products;
},
updateCart(carts) {
this.cart = carts;
},
updateSingleProduct(updatedProduct) {
const index = this.product.findIndex((p) => p.id === updatedProduct.id);
if (index !== -1) {
@@ -54,7 +47,7 @@ export const useStore = defineStore("maindev", {
},
persist: {
pick: ["token", "login", "lang", "dealer", "lastlegendfiltertab", "layersetting"],
pick: ["token", "login", "lang"],
storage: piniaPluginPersistedstate.localStorage(),
},
});