diff --git a/sheep/components/s-layout/s-layout.vue b/sheep/components/s-layout/s-layout.vue index 573a1c0..5bcd4c0 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); } - }); + })