vue-countTo
vue-countTo copied to clipboard
It's a vue component that will count to a target number at a specified duration https://panjiachen.github.io/countTo/demo/
小数会被自动四舍五入,比如填写了1.4得到的结果就是1,能不能加个控制的开关呢?
23456789 -> 2345.68万, 1234456789 -> 12.34亿
thank you!
``` [{ "resource": "components/PanelGroup.vue", "owner": "_generated_diagnostic_collection_name_#2", "code": "7016", "severity": 8, "message": "Could not find a declaration file for module 'vue-count-to'. 'admin/node_modules/.pnpm/[email protected]/node_modules/vue-count-to/dist/vue-count-to.min.js' implicitly has an 'any' type.\n Try `npm i --save-dev...
报错位于formatNumber方法,t参数,执行t.toFixed报错,需要区别对待,if判断t是数字类型就执行toFixed,如果不是就写else.  代码如上。
由于中国人的语言中,数字为四位一进而非西方的三位一进,所以我增加了`size`参数用于灵活的控制分隔符出现间隔