不知道小程序 appid,如何跳转

江河/ 2023年07月24日/ 小程序/ 浏览 843

微信小程序早就不限制跳转其他小程序的数量了,而且也不再需要再在 navigateToMiniProgramAppIdList  中声明 appid了。


wx.navigateToMiniProgram 除了支持 appId、path 跳转之外,还支持 shortLink 跳转。


小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。



示例代码:


wx.navigateToMiniProgram({
	shortLink: '目标小程序链接',
	success(res) {
		console.log('跳转成功')
	}
})


相对于 appid、path 方式这种方式比较简陋,也无法携带参数,因为参数都会被忽略……

发表评论

暂无评论,抢个沙发...

客服 工单