Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

mn-counter step 为小数时候, 精度丢失问题 #188

Open
ethanyou725 opened this issue Jan 2, 2018 · 2 comments
Open

mn-counter step 为小数时候, 精度丢失问题 #188

ethanyou725 opened this issue Jan 2, 2018 · 2 comments

Comments

@ethanyou725
Copy link

<template> <mn-counter v-model="models.counter" :min="5" :step='0.1'></mn-counter> </template>
image

@chasewoo
Copy link
Contributor

chasewoo commented Jan 2, 2018

@youzhigang 有没有解决办法?

@ethanyou725
Copy link
Author

ethanyou725 commented Jan 4, 2018

@Minowu 在 step 是小数的情况下, 使用组件的时不使用 v-model, 在@input="someMethod" 内手动修正精度
<mn-counter @input="test" :value="models.counter" :min="5" :step='0.1'></mn-counter>

methods: { test (v) { this.models.counter = +(v).toFixed(1) } }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants