diff --git a/src/platforms/mp-baidu/runtime/wrapper/util.js b/src/platforms/mp-baidu/runtime/wrapper/util.js index c429e6c108ae8da245c1e1458afd604fa987d6b3..17ed556440f275657b2559b7792358127cc8e943 100644 --- a/src/platforms/mp-baidu/runtime/wrapper/util.js +++ b/src/platforms/mp-baidu/runtime/wrapper/util.js @@ -1,9 +1,11 @@ export const mocks = ['nodeId', 'componentName', '_componentId', 'uniquePrefix'] export function isPage () { - return !this.ownerId + // 百度小程序组件的id,某些情况下可能是number类型的0,不能直接return !this.ownerId 判断当前组件是否是Page + // 否则会导致mounted不执行 + return typeof this.ownerId === 'undefined' } export function initRelation (detail) { this.dispatch('__l', detail) -} +}