个人中心:登录切换到自己的逻辑

This commit is contained in:
YunaiV
2023-12-28 22:59:14 +08:00
parent c3cc5d653d
commit f0e8ff1f87
9 changed files with 45 additions and 59 deletions
+6 -3
View File
@@ -85,9 +85,12 @@ const cart = defineStore({
}
},
// 清空购物车
async emptyList() {
await this.delete(this.list.map((item) => item.id));
// 清空购物车。注意,仅用于用户退出时,重置数据
emptyList() {
this.list = [];
this.selectedIds = [];
this.isAllSelected = true;
this.totalPriceSelected = 0;
},
},
persist: {