question: how to use the el-input box of elementUI to make the bound data display normally when the initial value is 0 ?
when using elementUI, it is found that when el-input is of type number, the initial value of the binding is 0, but it is not displayed, as shown in figure
number0
0
el-inputinput
el-input0
0
html
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui@2.2.2/lib/index.js"></script>
<div id="app">
<el-input v-model="input" type="number"></el-input>
</div>
js
var Main = {
data() {
return {
input: 0
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount("-sharpapp")
the version I use is 2.3.4, and it can be displayed normally when the official website examples are 2.4.5 and 2.2.2.
also found that even if the type of el-input is text, bound data with an initial value of 0, it will not be displayed, and the string 0 will be normal.
confused, solve the doubt