From 53899380c300e556ef2da166de9cfdb7687e25be Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 7 Jan 2025 16:08:57 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E3=80=90=E7=BC=BA=E9=99=B7=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=91s-layout=20=E7=BB=84=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=20onMounted=20=E7=9B=91=E5=90=AC=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8A=A0=E8=BD=BD=EF=BC=8C=E8=A7=A3=E5=86=B3=20H5=20?= =?UTF-8?q?=E4=B8=AD=E5=88=86=E4=BA=AB=E4=BF=A1=E6=81=AF=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sheep/components/s-layout/s-layout.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sheep/components/s-layout/s-layout.vue b/sheep/components/s-layout/s-layout.vue index 573a1c0d..5bcd4c0d 100644 --- a/sheep/components/s-layout/s-layout.vue +++ b/sheep/components/s-layout/s-layout.vue @@ -60,7 +60,7 @@ /** * 模板组件 - 提供页面公共组件,属性,方法 */ - import { computed } from 'vue'; + import { computed, onMounted } from 'vue'; import sheep from '@/sheep'; import { isEmpty } from 'lodash-es'; // #ifdef MP-WEIXIN @@ -212,11 +212,12 @@ }); // #endif - onShow(() => { + // 组件中使用 onMounted 监听页面加载,不是页面组件不使用 onShow + onMounted(()=>{ if (!isEmpty(shareInfo.value)) { sheep.$platform.share.updateShareInfo(shareInfo.value); } - }); + })