mirror of
https://github.com/Dichgrem/Vue.git
synced 2025-12-16 13:41:59 -05:00
32 lines
835 B
HTML
32 lines
835 B
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" connect="width=devices-width,initial-scale=1.0" />
|
|
<title>Vue3 demo</title>
|
|
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
|
</head>
|
|
<body>
|
|
<div style="text-align: center" id="app">
|
|
<h1>{{ count }}</h1>
|
|
<button v-on:click="clickButton">单击</button>
|
|
</div>
|
|
</body>
|
|
<!--hello-->
|
|
<script>
|
|
const App = {
|
|
data() {
|
|
return {
|
|
count: 0,
|
|
};
|
|
},
|
|
methods: {
|
|
clickButton() {
|
|
this.count = this.count + 1;
|
|
},
|
|
},
|
|
};
|
|
Vue.createApp(App).mount("#app");
|
|
</script>
|
|
</html>
|