Vue wants to enter numbers in the input box, and DOM loops out the number of input numbers

vue wants to enter numbers in the input box, and DOM loops out the number of input numbers
simple layout code

<input type="number" v-model="desc" value="desc">
<h1 v-for="(item,index) of desc" :key="index">
  {{ msg }}
</h1>

data data. 5

is passed by default.
 msg: "Wel",
 desc: 5
The

page shows 5 normal dom
clipboard.png

desc.length

clipboard.png
so I would like to ask the boss if you need to change it or not, if the description is not clear enough, you can comment and leave a message. Thank you!

Jul.11,2021

of = > in



<h1 v-for="(item,index) in +desc">
    {{ msg }}
</h1>

to put it this way, the value obtained by input does not seem to be correct. It is of the type of string. Just convert it in the loop.

Menu