airyland / airyland/vux

rater 组件转小数问题

Open
#3,800 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
17.5k
Forks
3.6k
PR merge metrics
No merged PRs in 30d

Description

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
},

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.