Vue钩子函数
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>跟著學亮學VUE</title>
</head>
<body><div id="app"><button @click="num++">+1</button><button @click="func1">調(diào)用func1</button><p>{{name}}</p>{{num}}</div>
</body>
<script src="node_modules/vue/dist/vue.js"></script>
<script>let app = new Vue({el:"#app",data:{name:"張學亮1111",num:1},methods:{func1(){console.log("我是方法func1")}},created() {this.name="created鉤子函數(shù)改變了name的值"}})</script>
</html>
與50位技術專家面對面20年技術見證,附贈技術全景圖
總結
- 上一篇: Oracle不带传出参数的存储过程创建及
- 下一篇: vue定义一个变量并显示