首先说明:个人项目用的是labrador框架
webview的使用步骤javascript
export default class Webview extends Component{ constructor(props){ super(props); this.state={ pagePath:' } } async onLoad(opt){ //这是从后台拿到的token,并保存在缓存中,此时获得 const Token = ... let url = 要跳转的网页路径 this.setState({pagePath:url}) } }
<view> <webview url="{{state.pagePath}}"></webview> </view>
wx.navigateTo({url:`/pages/webview/webview?${须要传递到webview页面的参数}`})
如此,不出意外,就能够了java
这只是个人用法,有其余用法欢迎评论web