weixin_慕标940172
2019-09-03 15:39
<!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>Vue中的计算属性和侦听器</title>
<script src="./vue.min.js"></script>
</head>
<body>
<div id="root2">
姓:<input v-model="firstname"/>
名<input v-model="lastname"/>
<div>{{fullname}}</div>
</div>
<script>
new vue({
el:"#root2",
data: {
firstname:'',
lastname:''
},
computed: {
fullname: function() {
return this.firstname + this.lastname
}
}
})
</script>
</body>
</html>
我知道了 new vue 没大写
vue2.5入门
146742 学习 · 657 问题
相似问题