Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div>
- <input
- v-for="input in inputs"
- :key="input.id"
- type="number"
- v-model="input.text"
- >
- <button @click="addInput">+</button>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- inputs: [
- {
- id: 1,
- text: ""
- }
- ]
- };
- },
- methods: {
- addInput() {
- this.inputs.push({
- id: this.inputs.length + 1,
- text: ""
- });
- }
- }
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement