vue - walterfan/walterfan GitHub Wiki

installation

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

Examples

import { createApp, ref } from 'vue'

createApp({
  setup() {
    return {
      count: ref(0)
    }
  }
}).mount('#app')

<div id="app">
  <button @click="count++">
    Count is: {{ count }}
  </button>
</div>

Single File Component

<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>
⚠️ **GitHub.com Fallback** ⚠️