Vue dynamically generates elements

clipboard.png
one click to add requires an input, and can bind data. How to implement

Apr.16,2021

The idea of

vue is not to generate elements dynamically, but to change the view by changing the data.

take a chestnut. At first, your data structure is that the medical history array under the disease is empty, the length of the medical history array is 1 after clicking, and then through the v-for loop to find out how many input you have.


<div v-for="item in items">
    <input />
</div>

where items is the component list.
you can push a component to this.items every time you click

.
onClick() {
    this.items.push(1)
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b302a0-2bcd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b302a0-2bcd5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?