摘要: let arr = ['随风','随雨','随缘']; obj = {}; for(var key in arr){ obj[key] = arr[key] } console.log(obj) 页面效果: 阅读全文
posted @ 2018-12-25 16:28 realman? 阅读(2350) 评论(0) 推荐(1) 编辑
摘要: 为了提高性能缓存dom查询; 页面效果: 阅读全文
posted @ 2018-12-25 16:08 realman? 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 项目中会遇到这样一个问题:后台给我们返回一个数组,但是少一个属性,我们要通过这个属性可能要控制一个事件。如果后台比较忙前台自己也可以添加一个属性: 后台的数据格式[[]], 采用双层遍历的方式: arr.map((item,i)=>{ item.tag.map((each,j)=>{ Vue.set 阅读全文
posted @ 2018-12-25 15:38 realman? 阅读(246) 评论(0) 推荐(0) 编辑
摘要: <template> <ul class="nav-list"> <li v-if="username ''" @click="logClick">登录</li> </ul> <my-dialog :is-show="isShowLogDialog" > <log-form @has-log="on 阅读全文
posted @ 2017-12-07 22:00 realman? 阅读(174) 评论(0) 推荐(0) 编辑
摘要: <div class="index-board-list"> <div class="index-board-item" v-for="(item, index) in boardList" :class="[{'line-last' : index % 2 !== 0}, 'index-board 阅读全文
posted @ 2017-12-03 20:22 realman? 阅读(841) 评论(0) 推荐(0) 编辑