The default value of element's el-input-number is set to empty
Used el-input-number
to limit the intelligent input of numbers in the input box, such as price, etc., when v-model
set to 空
and null
, the default value is displayed as the minimum value allowed to be input. as follows:
<el-input-number v-model="formData.idx" :precision="0" :step="1" :min="1" :max="100000"></el-input-number>
<el-input-number v-model="formData.winnersNum" :precision="0" :step="1" :min="1" :max="500"></el-input-number>
data(){
return {
formData: {
idx: null,
winnersNum: ''
}
}
}
Page effect:
Solution: v-model
set it to undefined
, that's it.
data(){
return {
formData: {
idx: undefined,
winnersNum: undefined
}
}
}
Page effect: