<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/vue.js"></script>
</head>
<body>
<div id="app">
<button @click="add">+</button>
<input type="text" v-model="num">
<button @click="sub">-</button>
</div>



<script>
var vm = new Vue({
el:"#app",
data:{
num:0,
},
methods:{
add(){
if(this.num>=10) {
this.num = 10
}else{
this.num++
}
},
sub(){
if(this.num<1) {
this.num = 0
}else{
this.num--
}
}


}
});

</script>

</body>
</html>