业务逻辑层
1、首先采用v-model实现数据双向绑定
2、当点击添加时将数据添加到一个空数组中
3、做一个循环
<li v-for="value in arr">{{value}}</li>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="../vue.js"></script>
</head>
<body>
<div id="app">
<input type="text" v-model="msg" >
<input type="button" value="添加" @click=add>
<ul>
<li v-for="value in arr">{{value}}</li>
</ul>
</div>
<script>
var vue=new Vue({
el:"#app",
data:{
msg:"",
arr:[]
},
methods:{
add:function(){
this.arr.push(this.msg)
},
}
})
</script>
</body>
</html>