Bug Type: Component
Environment
- Vue Version:
3.2.45
- Element Plus Version:
2.2.23
- Browser / OS:
Firefox 107.0 / Mac OS X 12.04
- Build Tool:
Other
Reproduction
Related Component
el-input-number
Reproduction Link
Element Plus Playground
Steps to reproduce
If you want to Type a Number between 1 and 0 the Component Auto-Completes it to 0.00 and then attached the following typed numbers to the end wich then round it up to the decimal place that is set in the precision Attribute
What is Expected?
F.E if a gauge Test writes 0,8 in the Component
What is actually happening?
The Component converts it to 0.1 because it writes 0,008 in the Component
Additional comments
(empty)
8条答案
按热度按时间yzckvree1#
I thinks it's normal ,this goes back to the value of
:precision :step
So if you are looking for 0.08 , you just need to change the step value to
:step="0.01"
, for 0.008 ::precision="3" :step="0.001"
rur96b6h2#
The 0,8 was just an example. Type a 0,5 to the Component in the Reproduction Link then you will see what i mean.
33qvvth13#
eh57zj3b4#
Wich Browser and OS do you use ? When i just type 0 the Component directly Autocompletes it to this:
This breaks my Gauge Tests because they cant handle that behaviour and just attach behind the 0.00
axr492tv5#
MAC OS X, make sure to put the
:precision="1"
mrphzbgm6#
Still the same behaviour
i2loujxw7#
Check out this one
You can put back the ref to 1
const num = ref(1)
t3irkdon8#
Still, it worked fine until the last update