赞
踩
gotogrant(url) {
var url = url;
uni.navigateTo({
// 此处的链接为小程序上面新建的webview页面路径,参数url为要跳转外链的地址
url: "/pages/index/grant?url=" + encodeURIComponent(url)+'&title='+"标题"
});
},
grant.vue,名字随便起,和上面保持一致就行
//url为要跳转外链的地址
<view>
<web-view :src="url">
</web-view>
</view>
<script> export default { data() { return { url:"" } }, onLoad(val) { console.log(val) //解码 this.url = decodeURIComponent(val.url); // 设置当前的title 如果外链中有的话将被覆盖 if(this.isNotEmpty(val.title)){ this.setTitle(val.title); } }, } </script>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。