diff --git a/packages/uni-cli-shared/components/page-meta.vue b/packages/uni-cli-shared/components/page-meta.vue index c231f39172bb47f7233d2d0884074d452335088c..5270cc2996ae1ec702a7b946e50cdb5d7f7b0f0b 100644 --- a/packages/uni-cli-shared/components/page-meta.vue +++ b/packages/uni-cli-shared/components/page-meta.vue @@ -53,10 +53,10 @@ export default { pageStyle: { type: String, default: '' - }, - enablePullDownRefresh: { - type: [Boolean, String], - default: false + }, + enablePullDownRefresh: { + type: [Boolean, String], + default: false }, rootFontSize: { type: String, @@ -81,8 +81,8 @@ export default { // 父节点一定是 page this.$pageVm.$on('hook:onPageScroll', evt => { this.$emit('scroll', evt) - }) - + }) + // #ifdef APP-PLUS this._currentWebview = page.$getAppWebview() if (this.enablePullDownRefresh) { @@ -90,7 +90,7 @@ export default { } this.$watch('enablePullDownRefresh', (val) => { this.setPullDownRefresh(this._currentWebview, val) - }) + }) // #endif // props @@ -124,16 +124,18 @@ export default { this.setPageMeta() } this.backgroundTextStyle && this.setBackgroundTextStyle() + }, + mounted () { this.scrollTop && this.pageScrollTo() }, - methods: { - setPullDownRefresh (webview, enabled) { - webview.setStyle({ - pullToRefresh: { - support: enabled, - style: plus.os.name === 'Android' ? 'circle' : 'default' - } - }) + methods: { + setPullDownRefresh (webview, enabled) { + webview.setStyle({ + pullToRefresh: { + support: enabled, + style: plus.os.name === 'Android' ? 'circle' : 'default' + } + }) }, setPageMeta () { // h5 和 app-plus 设置 rootFontSize @@ -187,4 +189,4 @@ export default { } } } - +