When the el-input type is number, the bound value of 0 is not displayed?

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
clipboard.png

number0
0
el-inputinput

el-input0

0

clipboard.png

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


is precisely because of the version problem, which was fixed by 2.3.5

.

it is recommended to update to the latest 2.4.X, because in version 2.4.0, input-number adds the precision attribute, which can limit the precision. It is convenient for many
2.3.3

.

2.3.4

version 2.3.5


< el-input-number VMI model = "num8" controls-position= "right" @ change= "handleChange": min= "1": max= "10" > < / el-input-number >

use el-input-number

Menu