<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小aa</title>
<!-- 引入vue(需要有网) -->
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
</head>
<body>
<div id="app">
<button @click="deValue">-</button>
<span>{{number}}</span>
<button @click="addValue">+</button>
</div>
<script>
new Vue({
el:"#app",
data:{
number:0
},
deValue(){
this.number--;
},
addValue(){
this.number++;
}
})
</script>
</body>
</html>
报错
解决
太粗心大意了