From 6c67d71f14f8bdc060138c877a790df357ca02b7 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Wed, 8 Apr 2020 12:16:58 +0800 Subject: [PATCH] docs: v3 this.$mp.page --> this.$scope --- docs/collocation/frame/window.md | 2 +- docs/component/input.md | 5 +++-- docs/component/web-view.md | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/collocation/frame/window.md b/docs/collocation/frame/window.md index 0f9140d8c..a5e4dfbf3 100644 --- a/docs/collocation/frame/window.md +++ b/docs/collocation/frame/window.md @@ -54,7 +54,7 @@ export default { }, onLoad() { // #ifdef APP-PLUS - const currentWebview = this.$mp.page.$getAppWebview(); //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里,直接使用plus.webview.currentWebview()无效 + const currentWebview = this.$scope.$getAppWebview(); //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效,非v3编译模式使用this.$mp.page.$getAppWebview() currentWebview.setBounce({position:{top:'100px'},changeoffset:{top:'0px'}}); //动态重设bounce效果 // #endif } diff --git a/docs/component/input.md b/docs/component/input.md index 7c5253432..0fe114c45 100644 --- a/docs/component/input.md +++ b/docs/component/input.md @@ -83,9 +83,10 @@ App平台在iOS上,webview中的软键盘弹出时,默认在软键盘上方 - 如需使用js动态设置softinputNavBar ```javascript -this.$mp.page.$getAppWebview().setStyle({ +this.$scope.$getAppWebview().setStyle({ softinputNavBar: 'none' -}) +}) +//this.$scope.$getAppWebview()相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效,非v3编译模式使用this.$mp.page.$getAppWebview() ``` 如果是nvue页面,默认就没有键盘上方的横条,无需任何设置。 diff --git a/docs/component/web-view.md b/docs/component/web-view.md index c3cdd0370..c458f0173 100644 --- a/docs/component/web-view.md +++ b/docs/component/web-view.md @@ -194,7 +194,7 @@ var wv;//计划创建的webview export default { onReady() { // #ifdef APP-PLUS - var currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象 + var currentWebview = this.$scope.$getAppWebview() //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效,非v3编译模式使用this.$mp.page.$getAppWebview() setTimeout(function() { wv = currentWebview.children()[0] wv.setStyle({top:150,height:300}) @@ -222,7 +222,7 @@ export default { top:uni.getSystemInfoSync().statusBarHeight+44 //放置在titleNView下方。如果还想在webview上方加个地址栏的什么的,可以继续降低TOP值 }) wv.loadURL("https://www.baidu.com") - var currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象 + var currentWebview = this.$scope.$getAppWebview(); //此对象相当于html5plus里的plus.webview.currentWebview()。在uni-app里vue页面直接使用plus.webview.currentWebview()无效,非v3编译模式使用this.$mp.page.$getAppWebview() currentWebview.append(wv);//一定要append到当前的页面里!!!才能跟随当前页面一起做动画,一起关闭 setTimeout(function() { console.log(wv.getStyle()) -- GitLab