vue - walterfan/walterfan GitHub Wiki
npm install -g @vue-cli
vue create guestbook
cd guestbook
# listen http port 8080
npm run serve
it generates
- index.html
- src/App.vue
- src/main.js
- src/asserts/logo.png
- src/components/HelloWorld.vue
import { createApp, ref } from 'vue'
createApp({
setup() {
return {
count: ref(0)
}
}
}).mount('#app')
<div id="app">
<button @click="count++">
Count is: {{ count }}
</button>
</div>
<script setup>
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<button @click="count++">Count is: {{ count }}</button>
</template>
<style scoped>
button {
font-weight: bold;
}
</style>