init
This commit is contained in:
31
Html-Vue/hello world.html
Normal file
31
Html-Vue/hello world.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
|
||||
<title>hello world</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
<script>
|
||||
Vue.createApp({
|
||||
data() {
|
||||
return {
|
||||
show:true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleBtnClick(){
|
||||
this.show=!this.show;
|
||||
}
|
||||
},
|
||||
template:`<div>
|
||||
<span v-if="show">hello</span>
|
||||
</div>
|
||||
<Button v-on:click="handleBtnClick">按钮</Button>`
|
||||
}).mount("#root");
|
||||
</script>
|
||||
</html>
|
Reference in New Issue
Block a user