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>