uview-plus icon indicating copy to clipboard operation
uview-plus copied to clipboard

up-text标签openType="share" 时,onShareAppMessage函数获取不到res.target.dataset中的自定义属性

Open humlzy opened this issue 1 year ago • 2 comments

问题描述 使用原生的botton按钮,调用分享功能时,onShareAppMessage方法的入参可以获取到res.target.dataset中自定义的shareinfo。 <button size="mini" type="primary" open-type="share" :data-shareinfo='dataInfo'>分享 如下图控制台打印 微信截图_20241226131947

我的需求是点击一行文字,触发分享功能,所以我使用up-text组件,此时onShareAppMessage函数无法获取到res.target.dataset中自定义的shareinfo 代码:<up-text text="分享" size="13" openType="share" align="right" color="#07CE52" suffixIcon="share" iconStyle="color:#07CE52" :data-shareinfo="dataInfo"> 微信截图_20241226132527

复现步骤 复现该行为的步骤:

  1. 前往'...'
  2. 点击'....'
  3. 滚动到'....'
  4. 查看错误

预期行为 清晰地描述你期望发生什么。

截图 如果适用,请添加截图以帮助解释你的问题。

版本(请填写以下信息)

  • HBuilderX:[4.36]
  • uview-plus:[3.3.54]
  • 开发者工具版本:[例如 微信开发者工具1.0.1]

平台(请填写以下信息)

  • 平台:[例如 微信小程序iOS]

智能手机(请填写以下信息)

  • 设备:[例如 iPhone6]
  • 操作系统:[例如 iOS8.1] 其他上下文 在此处添加有关问题的任何其他上下文。

humlzy avatar Dec 26 '24 05:12 humlzy

<up-button openType="share" plain size="small" icon="share" text="分享" :data-shareinfo='dataInfo'>同理,也获取不到

humlzy avatar Dec 26 '24 05:12 humlzy

试试参考此章节 image

ijry avatar Dec 30 '24 11:12 ijry