记录一下

小程序 bindtap传参

小程序 bindtap传参

但是 由于 数据太长的话 会报错VM14233:1 MiniProgramError Unexpected end of JSON input SyntaxError: Unexpected end of JSON input

所以在对数据进行encodeURIComponent转码
var product = encodeURIComponent(JSON.stringify(e.currentTarget.dataset.product));
接收时使用
var product = JSON.parse(decodeURIComponent(options.product));
就可以了

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-20
  • 2021-05-30
  • 2022-02-26
  • 2021-10-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案