Vue
HTML
<div id="app">
<input type="text" class="inp" v-model="title">
<input type="button" value="Добавить" @click="addItem">
<div class="over">
<div v-for = "name in names">
<p>{{name}}</p>
</div>
</div>
</div>
CSS
body {
background: gray;
overflow: hidden;
}
p {
padding: 5px;
}
.over {
width: 200px;
height: 120px;
margin: 10px;
overflow: auto;
background-color: white;
font-size: 2rem;
}
.inp {
margin: 10px;
}
Vue
new Vue({
el: "#app",
data: {
title: '',
names: []
},
methods: {
addItem() {
this.names.push(this.title);
this.title = '';
}
}
})