Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
humlzy opened this issue Dec 26, 2024 · 2 comments

Comments

@humlzy
Copy link

humlzy commented Dec 26, 2024

问题描述
使用原生的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
Copy link
Author

humlzy commented Dec 26, 2024

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

@ijry
Copy link
Owner

ijry commented Dec 30, 2024

试试参考此章节
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants