Vue click the button to dynamically add input and get the value entered by input

Click the button once to dynamically add an input, to get the value of the input input when the input input is worth it

Sep.24,2021

when you click the button, add a text box and bind the event at the same time. When you change, the output value will be fine

the following is a sample code for vue

<template>
  <div>
    <input type="text" v-for="(item,i) of items" v-model="items[i]" :key="i">
    <button @click="onAdd"></button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      items: []
    }
  },
  methods: {
    onAdd() {
      this.items.push('')
    }
  }
}
</script>
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-1b383a7-2c103.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-1b383a7-2c103.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?