随笔分类 -  Vue

Vue调用函数的括号问题
摘要:在事件中加不加括号都可以 <div id="h1"> <input type="button" value="点击" @click="showInfo()"><br> <input type="button" value="点击" @click="showInfo"> </div> 在差值表达式中调 阅读全文
posted @ 2022-06-05 18:20 西凉# 阅读(289) 评论(0) 推荐(0)
Vue事件修饰符
摘要:视频地址:https://www.bilibili.com/video/BV1Zy4y1K7SH?p=15 stop阻止事件冒泡 prevent阻止默认事件 once 首先回顾一下什么是事件冒泡,当鼠标点击button按钮的时候,同时也点击了div,所以showInfo1和showInfo两个函数会 阅读全文
posted @ 2022-06-04 21:21 西凉# 阅读(23) 评论(0) 推荐(0)
vue本地应用
摘要:v-text v-html 计数器 v-show v-if v-bind v-text v-html: <div id="h1"> <p v-html="h2"></p> <p v-text="h3"></p> </div> <script> var vue = new Vue({ el: "#h1 阅读全文
posted @ 2022-06-01 01:03 西凉# 阅读(51) 评论(0) 推荐(0)
Vue的data数据对象
摘要:<body> <div id="hh"> {{message}} <h2>{{school.name}} {{school.mobile}}</h2> <ul> <li>{{campus[0]}}</li> <li>{{campus[1]}}</li> </ul> </div> <script> v 阅读全文
posted @ 2022-05-31 22:20 西凉# 阅读(80) 评论(0) 推荐(0)
el挂载点
摘要:el挂载div <body> <div id="hh">{{message}}</div> <script> var vue = new Vue({ el: "div", data: { message: "nmsl" } }) </script> </body> el挂载id <div id="h 阅读全文
posted @ 2022-05-31 21:46 西凉# 阅读(27) 评论(0) 推荐(0)