摘要: <input type="text" v-model="id"> <input type="text" v-model="name"> <button @click="add"></button> <ul> <li v-for="item in list"> {{item.name}} <input 阅读全文
posted @ 2020-05-14 22:34 心意如水hucuie22 阅读(426) 评论(0) 推荐(0) 编辑
摘要: <li v-for="(val,key,i) in user">{{val}} --{{key}} -{{i}}</li> 第一个是val,第二是键,第三个是索引 data:{ user:{ id:"1", name:"22" } } in后面可以放数组。普通数组。对象数组,对象,还可以放数字 v- 阅读全文
posted @ 2020-05-14 22:14 心意如水hucuie22 阅读(493) 评论(0) 推荐(0) 编辑
摘要: body .thin{ color:red } 1.数组的形式添加样式 .<div :class='["thin","title"]'>ddddddddd</div> 2.数组中使用三元表达式 .<div :class='["thin","title",isactive?"active":""]'> 阅读全文
posted @ 2020-05-14 20:59 心意如水hucuie22 阅读(1187) 评论(0) 推荐(0) 编辑
摘要: <select v-model="Selects"> <option value="+">+</option> <option value="-">-</option> <option value="*">*</option> <option value="/">/</option> </selec 阅读全文
posted @ 2020-05-14 18:05 心意如水hucuie22 阅读(641) 评论(0) 推荐(0) 编辑
摘要: v-bind只能实现数据的单项绑定 使用v-model指令可以实现表单元素和model中数据的双向数据绑定 注意:v-model只能用于表单元素之中 阅读全文
posted @ 2020-05-14 17:44 心意如水hucuie22 阅读(413) 评论(0) 推荐(0) 编辑
摘要: <script> var app=new Vue({ el:"#app", data:{ title:"9999", msg:"猥琐发育,别浪", interval:null, }, methods:{ lang:function(){ //定时器不为空的时候执行 if(this.interval! 阅读全文
posted @ 2020-05-14 15:19 心意如水hucuie22 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 指向这个实列 在事件里面建议用箭头的函数,不用考虑this的指向问题。 如果不用需要方法里面先声明var _this=this; lang:function(){ setInterval(() => { var start=this.msg.substring(0,1); var end=this. 阅读全文
posted @ 2020-05-14 15:01 心意如水hucuie22 阅读(164) 评论(0) 推荐(0) 编辑