小程序新的版本onShareAppMessage 里面有 from 判断,下面是小程序手册里面的描述,但我加了from 后 报错,说from没定义?!
Page({
onShareAppMessage: function (res) {
if (res.from === 'button') {
// 来自页面内转发按钮
console.log(res.target)
}
return {
title: '自定义转发标题',
path: '/page/user?id=123',
success: function(res) {
// 转发成功
},
fail: function(res) {
// 转发失败
}
}
}
})
看一下基础库版本