onAppRoute这个是小程序的一个隐藏的方法。自己可以打印看看
在app.js中
onLaunch () {
this.mpShare()
},
mpShare () {
wx.onAppRoute(res => {
const pages = getCurrentPages()
const view = pages[pages.length - 1]
if (view) {
const data = view.data
if (!data.isMpShare) {
data.isMpShare = true
view.onShareAppMessage = () => {
return {
title: '小程序',
path: '/pages/home/home'
}
}
}
}
})
},
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。