【缺陷修复】s-layout 组件中使用 onMounted 监听页面加载,解决 H5 中分享信息获取失败的问题

pull/134/head
puhui999 2025-01-07 16:08:57 +08:00
parent bc0e731fc3
commit 53899380c3
1 changed files with 4 additions and 3 deletions

View File

@ -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);
}
});
})
</script>
<style lang="scss" scoped>