From 3d1e1751944c1eac47f448368125f8d73eede101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Mon, 16 Aug 2021 11:34:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A5=BC=E5=B1=82=E8=A3=85?= =?UTF-8?q?=E4=BF=AE=E4=B8=AD=E5=95=86=E5=93=81=E8=A3=85=E4=BF=AE=E5=87=BA?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=BB=98=E8=AE=A4=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/home/template/tpl_goods.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pages/tabbar/home/template/tpl_goods.vue b/pages/tabbar/home/template/tpl_goods.vue index 839dc1d..21d8785 100644 --- a/pages/tabbar/home/template/tpl_goods.vue +++ b/pages/tabbar/home/template/tpl_goods.vue @@ -33,12 +33,22 @@ export default { return { selected: { index: 0, - val: "精选", + val: "", }, }; }, props: ["res"], - mounted() {}, + watch: { + res: { + handler(val) { + // 监听父级的值 如果有值将值赋给selected + if (val) { + this.selected.val = this.res.list[0].listWay[0].type; + } + }, + immediate: true, + }, + }, methods: { handleClick(item) { uni.navigateTo({