slider 滑动value数值精度问题
我设了步长为1,滑动过程会出现精度问题,当前亮度是我用setdata设置的,调整亮度是组件showValue的,三张图都没有进行精度处理。
< button >当前屏幕亮度</ button > < text >{{screenBrightness*100 + '%'}}</ text > < button >调整亮度</ button > < slider bindchange = "changeLightness" min = "0" max = "1" step = "0.01" show-value value = "screenBrightness" /> |
data: { networkType: '' , screenBrightness: 1 }, changeLightness: (e) => { wx.setScreenBrightness({ value: e.detail.value , success: () => { self.setData({ screenBrightness: e.detail.value }) } })}, |