上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页
摘要: praseInt(string , radix), radix默认10, parseInt是将radix进制数转成10进制数 console.log(praseInt(10, 2)) // 2 console.log(10, 8) // 8console.log(praseInt(10, 16)) 阅读全文
posted @ 2020-09-10 13:49 baixinL 阅读(310) 评论(0) 推荐(0)
摘要: this.$refs.refName.$el.style.opacity = '0.5' 阅读全文
posted @ 2020-09-02 17:18 baixinL 阅读(2547) 评论(0) 推荐(0)
摘要: 加载字体的方法 uni.loadFontFace({ family: '中英文都可', source: `url('${host}/static/xxx/xxx.ttf')`, success() { console.log('success') }, fail(res) { console.log 阅读全文
posted @ 2020-09-02 17:14 baixinL 阅读(1561) 评论(0) 推荐(0)
摘要: forEach forEach遍历完整,不会中断,在其内部使用return也只是起到continue的作用,仅跳过当前这条 arr.forEach((item, index, arr1) => { ... }) map map 遍历完整,不中断,返回新数组 const map1 = arr.map( 阅读全文
posted @ 2020-09-02 17:01 baixinL 阅读(353) 评论(0) 推荐(0)
摘要: const request = uni.request({....}) request .abort() 对于并行请求,如出现登录过期等, 可以把未响应的请求取消掉。 阅读全文
posted @ 2020-09-02 15:54 baixinL 阅读(1979) 评论(0) 推荐(0)
摘要: 详情参考:https://uniapp.dcloud.io/api/router?id=relaunch uni.navigateTo(OBJECT) 保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack可以返回到原页面。 使用场景:需要返回不刷新原页面数据时使用。 注意: 页 阅读全文
posted @ 2020-09-02 10:41 baixinL 阅读(619) 评论(0) 推荐(0)
摘要: 具体参考:https://segmentfault.com/q/1010000010686439 由于vue对象是可以使用$emit、$on可以派发和接收事件 在父子组件都引入eventBus.js文件,自定文件(import eventBus from '@/utils/eventBus.js') 阅读全文
posted @ 2020-08-27 14:35 baixinL 阅读(401) 评论(0) 推荐(0)
摘要: var timer = setInterval(() => { console.log('hahaha'); }, 5000); this.$once('hook:beforeDestroy',() => { clearInterval(timer ) timer = null; }) 阅读全文
posted @ 2020-08-26 11:23 baixinL 阅读(549) 评论(0) 推荐(0)
摘要: 可以使用$set this.$set(数组, index, row) // index,要更新数据在该数组中的索引 // row,要更新数据 阅读全文
posted @ 2020-08-25 16:20 baixinL 阅读(402) 评论(0) 推荐(0)
摘要: 在图片编辑状态下,需要回显图片,可以给el-upload的file-list绑定的变量进行赋值 上传的文件列表, 例如: [{name: 'food.jpg', url: 'https://xxx.cdn.com/xxx.jpg'}] 主要是要有参数url,name可以没有,也可以增加更多的参数 阅读全文
posted @ 2020-08-25 16:13 baixinL 阅读(4679) 评论(0) 推荐(1)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 下一页