---
# System prepended metadata

title: Vue 起手式
tags: [Vue]

---

# Vue 起手式
###### tags: `Vue`
2022.2.28
開發者工具：https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd/related

```
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
</head>
<body>
    <script src="https://unpkg.com/vue@3"></script>
    <div id = "app">
        {{counter}}
        <button type="button" v-on:click ="clickMe">按我</button>
    </div>
    <script>
        const app = {
            data(){
                return{
                    counter:0,
                }
            },
            created(){
                this.counter = 10
            },

            methods:{
                clickMe(){
                    this.counter +=1;
                }
            }
        }

        Vue.createApp(app).mount('#app')
    </script>
</body>
</html>
```