提交 be931100 编写于 作者: 雪洛's avatar 雪洛

fix: 修复百度小程序触发两次onShow的BUG askID-81243

上级 6064e095
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
}, },
"dependencies": { "dependencies": {
"base64-arraybuffer": "^0.2.0", "base64-arraybuffer": "^0.2.0",
"compare-versions": "^3.5.1",
"intersection-observer": "^0.7.0", "intersection-observer": "^0.7.0",
"safe-area-insets": "^1.4.1" "safe-area-insets": "^1.4.1"
}, },
......
...@@ -2,6 +2,8 @@ import { ...@@ -2,6 +2,8 @@ import {
hasOwn hasOwn
} from 'uni-shared' } from 'uni-shared'
import compareVersions from 'compare-versions'
import { import {
isPage, isPage,
initRelation initRelation
...@@ -28,8 +30,10 @@ export default function parseComponent (vueOptions) { ...@@ -28,8 +30,10 @@ export default function parseComponent (vueOptions) {
this.$vm.__call_hook('onLoad', this.pageinstance._$args) this.$vm.__call_hook('onLoad', this.pageinstance._$args)
delete this.pageinstance._$args delete this.pageinstance._$args
} }
// TODO 目前版本 百度 Component 作为页面时,methods 中的 onShow 不触发 // TODO 3.105.17以下基础库内百度 Component 作为页面时,methods 中的 onShow 不触发
this.$vm.__call_hook('onShow') if (compareVersions.compare(swan.getEnvInfoSync().sdkVersion, '3.105.17', '<')) {
this.$vm.__call_hook('onShow')
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册