欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Vue 3(alpha) 官方的演示 Demo

程序员文章站 2022-05-17 10:07:39
...

https://github.com/vuejs/vue-next-webpack-preview/blob/master/src/App.vue

<template>
  <img src="./logo.png">
  <h1>Hello Vue 3!</h1>
  <button @click="inc">Clicked {{ count }} times.</button>
</template>

<script>
import { ref } from 'vue'
export default {
  setup() {
    const count = ref(0)
    const inc = () => {
      count.value++
    }
    return {
      count,
      inc
    }
  }
}
</script>

<style scoped>
img {
  width: 200px;
}
h1 {
  font-family: Arial, Helvetica, sans-serif;
}
</style>
相关标签: Vue vue3

上一篇: 计算属性 3

下一篇: Vue3开发踩坑