The H5 page embedded in the webview of the applet, click the button to return to the specified page of the applet

I made an event today. First, enter the H5 page in the webview from the applet, and then there is a button in the H5 page. After clicking, you need to jump to the registration page of the applet. So, how to achieve it on the H5 side? Because it has entered the applet environment, it is relatively simple to implement the relatively simple H5 jump applet

1. Install the WeChat plug-in for the Vue project on the H5 page

npm install --save weixin-js-sdk

Two, vue file reference

//在需要跳转的页面 引入插件
import wx from 'weixin-js-sdk'

3. Use to jump to the specified page of the applet

//直接在触发的方法里面写入
wx.miniProgram.navigateTo({
    
    
   url: '/pages/register/register' //小程序必须有该目录
})

Guess you like

Origin blog.csdn.net/TKP666/article/details/129175508