z***@163.com
z***@163.com
  • 发布:2024-07-10 12:46
  • 更新:2024-07-10 20:54
  • 阅读:154

【报Bug】点击事件获取参数如为小数,获取错误

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 14.4.1

HBuilderX类型: 正式

HBuilderX版本号: 4.23

手机系统: iOS

手机系统版本号: iOS 16

手机厂商: 苹果

手机机型: iphone X

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

<template>
<button @click="aaa" :data-item="price">测试</button>
</template>

<script>
export default {
data () {
return {
price: 25.88
}
},
methods: {
aaa: function (e) {
uni.showModal({
title: '提示',
content: e.currentTarget.dataset.item + '',
})
}
}
}
</script>

<style>
</style>

操作步骤:

点击测试

预期结果:

期望得到25.88

实际结果:

实际得到25.880000000000003

bug描述:

从点击事件中获取参数,绑定参数如果是小数,获取得到的值错误

2024-07-10 12:46 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

运行到哪里产生问题呢?

  • DCloud_UNI_yuhe

    感谢反馈,运行到ios上发现问题,正在进行针对性测试

    2024-07-10 21:06

要回复问题请先登录注册