跳至主要內容

Vue应用实例的创建


Vue应用实例的创建

Vue应用实例
<template>
  <div style="text-align: center;" id="Application">
    <h1>{{ count }}</h1>
    <button v-on:click="clickButton">点击</button>
  </div>
</template>
<script>
export default {
  data(){
      return{
          count: 0
      }
  },
  methods: {
    clickButton() {
      this.count = this.count + 1
    }
  },
};
</script>
上次编辑于:
贡献者: Neil