Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <template>
  2. <div>
  3. <input
  4. v-for="input in inputs"
  5. :key="input.id"
  6. type="number"
  7. v-model="input.text"
  8. >
  9. <button @click="addInput">+</button>
  10. </div>
  11. </template>
  12.  
  13. <script>
  14. export default {
  15. data() {
  16. return {
  17. inputs: [
  18. {
  19. id: 1,
  20. text: ""
  21. }
  22. ]
  23. };
  24. },
  25. methods: {
  26. addInput() {
  27. this.inputs.push({
  28. id: this.inputs.length + 1,
  29. text: ""
  30. });
  31. }
  32. }
  33. };
  34. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement