JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.js"></script>
<div id="app">
<h1>Finds</h1>
<div>
<input ref="option">
</div>
<button v-if @click="addFind">
New Find
</button>
<p v-for="(option,idx) in options">
<span @click="removeOption(idx)">Option{{idx}}: {{option}}</span>
</p>
<pre>There are {{ options.length }} options</pre>
</div>
JavaScript
new Vue({
el: '#app',
data: {
options: [],
},
methods: {
addFind: function () {
let msg = this.$refs.option.value;
console.log(this.options);
if( msg.trim() != "" ){
this.options.push(msg.trim());
}
},
removeOption:function(index){
this.options.splice(index,1);
}
}
});