uniapp跳转到外部链接
【代码】uniapp跳转到外部链接。
·
// 一、先配置页面
{
"path": "pages/webview/webview",
"style": {
"navigationBarTitleText": ""
}
}
// 二、编写页面
<template>
<web-view :src="src" />
</template>
<script>
export default {
data() {
return {
src: "",
title: "",
};
},
onLoad(option) {
this.src = decodeURIComponent(option.src);
this.title = option.title;
uni.setNavigationBarTitle({ title: this.title });
},
};
</script>
//三 使用
//src2 就是要跳转的链接
uni.navigateTo({url: `/pages/webview/webview?src=${src2}`});
更多推荐
已为社区贡献2条内容
所有评论(0)