mirror of
https://github.com/Dichgrem/Vue.git
synced 2025-12-16 21:51:59 -05:00
start:vue3
This commit is contained in:
31
vue1.html
Normal file
31
vue1.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user