我这里有两个分享的button
转发的内容不一样,可以在onShareAppMessage 判断来自哪个button吗?我试了data-xx, 但是options.target里没有xx
<van-button type="primary" size="normal" open-type='share'>分享1</van-button>
<van-button type="primary" size="normal" open-type='share'>分享2</van-button>
onShareAppMessage: function( options ) {
console.log(options)
if (options.from === 'button1') {
return {
title: '有个位置发给你!',
}
} else if(options.from === 'button2') {
return {
title: 'fjji'
}
}
},
可以用data-xx