You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is also a solution that refers to input, because the default of the v-model of el-input is "" and the el-input-number is undefined, changed to" ", so this will change the bottom of the inside will be relatively large, To remove some unnecessary null and undefined judgment
Personally, I prefer the second option
The text was updated successfully, but these errors were encountered:
I think the feature you requested out of the semantics of valueOnClear. What you actually want is something like defaultValue which sets a default value when the value is undefined or null. But I don't see the need for it, and just set the initial value same as valueOnClear.
Bug Type:
Component
Environment
3.4.19
2.7.2
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Vite
Reproduction
Related Component
el-input-number
Reproduction Link
Element Plus Playground
Steps to reproduce
输入数字后删除
Enter a number and delete it
What is Expected?
期望也可以切换到 valueOnClear
want set valueOnClear
What is actually happening?
没有设置 valueOnClear
valueOnClear not set at first time
Additional comments
我稍微思考了下,有2个方案
I've given it some thought, and there are two options
合并这里的代码 https://github.com/element-plus/element-plus/blob/dev/packages/components/input-number/src/input-number.vue#L214
Merge the code here https://github.com/element-plus/element-plus/blob/dev/packages/components/input-number/src/input-number.vue#L214
这样会有个问题是 valueOnClear 会默认展示,但改动是比较小的
One problem with this is that valueOnClear displays by default, but the changes are minor
个人比较倾向于第二种
Personally, I prefer the second option
The text was updated successfully, but these errors were encountered: