|
@@ -0,0 +1,30 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+<head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title>Document</title>
|
|
|
+ <script src="./js/vue.js"></script>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+ <div id="app">
|
|
|
+ <h1 v-if="num <= 10">{{num}}</h1>
|
|
|
+ <h1 v-else>已经为最大值了</h1>
|
|
|
+ <button @click="addFun">add</button>
|
|
|
+ </div>
|
|
|
+ <!-- <div>{{num}}</div> -->
|
|
|
+ <script>
|
|
|
+ let app = new Vue({
|
|
|
+ el: '#app',
|
|
|
+ data:{
|
|
|
+ num:0
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ addFun:function(){
|
|
|
+ this.num++
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+</body>
|
|
|
+</html>
|