方案1
使用uni-app的擴(kuò)展組件 uni-link,使用參考文檔uni-app官網(wǎng)
該組件的行為是在app內(nèi)打開外部瀏覽器,在h5打開新網(wǎng)頁。
方案2:
通過先跳轉(zhuǎn)到web-view頁面,通過web-view這個標(biāo)簽進(jìn)行動態(tài)綁定接收來的有效可訪問網(wǎng)址,即可實(shí)現(xiàn)跳轉(zhuǎn)功能 在pages中新建一個webview頁面 如下。
<template>
<web-view :src="webUrl"></web-view>
</template>
<script>
export default {
name: "webview",
data() {
return {
webUrl: 'https://m.baidu.com'
};
},
}
</script>
<style>
</style>
然后在pages.json中配置webview.vue頁面路徑
{
"path" : "pages/webview/webview",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
然后做一個跳轉(zhuǎn)文章來源:http://www.zghlxwxcb.cn/news/detail-503633.html
go() {
uni.navigateTo({
url: '/pages/webview/webview'
})
},
在模擬器上 不存在跳轉(zhuǎn)的網(wǎng)站有https和http之分都可以跳轉(zhuǎn)。文章來源地址http://www.zghlxwxcb.cn/news/detail-503633.html
到了這里,關(guān)于uniapp小程序跳轉(zhuǎn)到外部頁面的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!