airyland / vux

Mobile UI Components based on Vue & WeUI
https://vux.li
MIT License
17.6k stars 3.72k forks source link

rater 组件转小数问题 #3800

Open lgl5240 opened 2 years ago

lgl5240 commented 2 years ago

vue.esm.js:629 [Vue warn]: Error in render: "TypeError: this.currentValue.toFixed is not a function"

found in

---> at node_modules\vux\src\components\rater\index.vue

at src\components\scroller\index.vue at src\view\goods\list.vue at src\App.vue 评分如果传进去是字符类型就会报错, 解决方式: sliceValue () { const _val = parseFloat(this.currentValue).toFixed(2).split('.') return _val.length === 1 ? [_val[0], 0] : _val },