From 477412e6f9f9729683cf4929f632ffea6be90f74 Mon Sep 17 00:00:00 2001 From: xiaoguang Date: Fri, 13 May 2022 18:06:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=97=A0=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF=E6=97=B6=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/module/header/HeaderCart.vue | 10 +++++++--- layouts/module/header/index.vue | 4 ---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/layouts/module/header/HeaderCart.vue b/layouts/module/header/HeaderCart.vue index 108899e..0c8ea03 100644 --- a/layouts/module/header/HeaderCart.vue +++ b/layouts/module/header/HeaderCart.vue @@ -5,6 +5,7 @@ trigger="hover" placement="bottom" width="330" + :disabled="cartCount === 0" >
购物车 -
- {{ cartProducts.length }} +
+ {{ cartCount }}
@@ -80,7 +81,7 @@
-

共{{ cartProducts.length }}件商品

+

共{{ cartCount }}件商品

去购物车 @@ -102,6 +103,9 @@ export default { }, computed: { ...mapState(["cartProducts", "token"]), + cartCount() { + return this.cartProducts.length; + }, }, watch: { cartProducts: { diff --git a/layouts/module/header/index.vue b/layouts/module/header/index.vue index 8454b85..9a56599 100644 --- a/layouts/module/header/index.vue +++ b/layouts/module/header/index.vue @@ -182,10 +182,6 @@ export default { };