文章目录
data节点和methods节点
<template>
<h1>这是App.vue根组件</h1>
<h3>abc----{{ username }}</h3>
<p>count值是:{{ count }}</p>
<button @click="addCount">+1</button>
</template>
<script>
export default {
name: "MyApp",
data() {
return {
username: "zs",
count: 0,
};
},
methods: {
addCount() {
this.count++;
},
},
};
</script>