Mini Program jumps another event about how Mini Program performed the jump through js.

the requirement is for Mini Program to jump to another Mini Program, but it does not need to be manually triggered by the user, and the jump will be performed as soon as the page is loaded.
I think the new API is navigator tag, there is no js to implement the method, solve?

<navigator target="miniProgram"  data-abc="asasasasa" open-type="navigate" app-id="" path="/pages/serve/serve" extra-data="" version="develop" bindsuccess="success">a</navigator>
Aug.19,2021

//
var navigateToMiniProgram = function(appid,path,data, envVersion, fun){
        var that = this;
        if(!appid) {
            return 
        }
        console.log("",appid,path,data)
        if( wx.navigateToMiniProgram ){
            try{
                wx.navigateToMiniProgram({
                    appId: appid ,
                    path: path ? path : 'pages/index/index',
                    extraData: data?data:{},
                    envVersion: envVersion || 'develop',
                    success(res) {
                        console.log('')
                        if(typeof fun == 'function') {
                            fun()
                        }
                    }
                })
            }catch(e){}
        }else{
            
        }
        
    }

but now this method has been abandoned


official documents

wx.navigateToMiniProgram(Object object)

Open another Mini Program associated under the same official account (Note: it must be under the same official account, not under the same open account)

Note: this interface is about to be adjusted. It is recommended that you use the < navigator > component to use this feature. Please refer to adjustment instructions

Menu