Simple history
by hraval24
HTML
<div id="vue">
<div v-for="item in items">
<input :value="fbffgitem.history[0]" @input="item.history.unshift($event.target.value)">
<button @click="item.history.splice(0, 1)" :disabled="item.history.length == 0">Undo</button>
<select @input="item.history.splice(0, $event.target.value);$event.target.selectedIndex = 0" :disabled="item.history.length == 0">
<option disabled selected style="display:none">History ({{item.history.length}})</option>
<option v-for="thing, i in item.history" :value="i">{{thing}}</option>
</select>
</div>
</div>
CSS
select{
width:90px;
}
JavaScript
new Vue({
el:'#vue',
data(){
return {
items:[
{history:[]},
{history:[]},
{history:[]}
]
}
}
})