提交 3e21fcfb 编写于 作者: Q qiang

fix(mp-baidu): 修复基础库 3.290.33+ 页面 mounted 执行两次的问题 fixed #2642

上级 498ca739
......@@ -3,7 +3,8 @@ export const mocks = ['nodeId', 'componentName', '_componentId', 'uniquePrefix']
export function isPage () {
// 百度小程序组件的id,某些情况下可能是number类型的0,不能直接return !this.ownerId 判断当前组件是否是Page
// 否则会导致mounted不执行
return typeof this.ownerId === 'undefined'
// 基础库 3.290.33 及以上 ownerId 为 null
return typeof this.ownerId === 'undefined' || this.ownerId === null
}
export function initRelation (detail) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册