The uniapp applet jumps to an external page

plan 1

Use the extension component uni-link of uni-app , use the reference document uni-app official website

The behavior of this component is to open an external browser inside the app and open a new webpage in h5.

Scenario 2:

By jumping to the web-view page first, and dynamically binding the received effective and accessible URL through the web-view label, the jump function can be realized. Create a new webview page in pages as follows.

<template>
    <web-view :src="webUrl"></web-view>
</template>
 
<script>
    export default {
        name: "webview",
        data() {
            return {
                webUrl: 'https://m.baidu.com'
            };
        },
    }
</script>
 
<style>
 
</style>

Then configure the webview.vue page path in pages.json

{
            "path" : "pages/webview/webview",
            "style" :                                                                                    
            {
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
            
        }

then do a jump

go() {
      uni.navigateTo({
        url: '/pages/webview/webview'
   })
},

Websites that do not have redirects on the emulator can be redirected either by https or http.

Guess you like

Origin blog.csdn.net/qq_34093387/article/details/129777211