上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 28 下一页
摘要: //识别并转换文本里的超链接 transSlink(value){ let reg = /(http:\/\/|https:\/\/|www)((\w|=|\?|\.|\/|&|~|-|[\u200B-\u200D\uFEFF])+)/g; let text = value.replace(reg, 阅读全文
posted @ 2022-02-18 16:59 huihuihero 阅读(160) 评论(0) 推荐(0) 编辑
摘要: ####转换对象数组格式 [{...},{...},{...},{...},{...}] → [{{...},{...}} , {{...},{...}} , {{...}}] 可用于vue多重v-for循环,如图 transObjData(info){ let resArr=[] let sonO 阅读全文
posted @ 2022-01-11 10:41 huihuihero 阅读(225) 评论(0) 推荐(0) 编辑
摘要: ####以时间排序为例 知识点:js原生数组排序 Array.sort(function(){}) 这种方法会改变原数组,无需return //处理函数 handleSort(arr){ arr.sort((a,b)=>{ let t1 = new Date(Date.parse(a.birthda 阅读全文
posted @ 2021-12-22 16:12 huihuihero 阅读(252) 评论(0) 推荐(0) 编辑
摘要: ###原理 1、通过 html2Canvas 将页面绘制成出来 2、通过 jspdf 将绘制出来的页面转为pdf 注意:想要绘制整个页面(包括滚动区域),建议 html2Canvas 的height使用scrollHeight+1000(或+500等,或不填也行) 如果使用clientHeight, 阅读全文
posted @ 2021-12-16 10:08 huihuihero 阅读(426) 评论(0) 推荐(0) 编辑
摘要: ####App环境 if (uni.getSystemInfoSync().platform == 'ios'){ plus.ios.import("UIApplication").sharedApplication().performSelector("exit") } else if (uni. 阅读全文
posted @ 2021-09-08 14:46 huihuihero 阅读(2013) 评论(0) 推荐(0) 编辑
摘要: ###方法 /*** 判断mac系统(含iphone手机) ***/ let isMac = /macintosh|mac os x/i.test(navigator.userAgent); /*** 判断windows系统 ***/ let isWindows = /windows|win32/i 阅读全文
posted @ 2021-08-26 10:23 huihuihero 阅读(363) 评论(0) 推荐(0) 编辑
摘要: ###力扣 leetcode https://www.leetcode.com ###领扣lintcode https://www.lintcode.com/problem ###牛客 nowcoder https://www.nowcoder.com ###codechef https://www 阅读全文
posted @ 2021-08-17 09:59 huihuihero 阅读(545) 评论(0) 推荐(0) 编辑
摘要: ####注:以下方式对移动端浏览器不可用,仅针对pc端使用 ####方式一,以生成并下载txt为例 function downTxt() { let filename = "这是txt文件名称.txt" //注意最好设置后缀.txt let value="这是txt文件的内容" let elem = 阅读全文
posted @ 2021-07-28 09:47 huihuihero 阅读(547) 评论(0) 推荐(0) 编辑
摘要: ##方案一:vue中使用clipboard实现文本复制功能(推荐) ####1、安装clipboard.js依赖 地址:https://github.com/zenorocha/clipboard.js yarn add clipboard 或 npm install clipboard --sav 阅读全文
posted @ 2021-07-27 17:11 huihuihero 阅读(1295) 评论(0) 推荐(0) 编辑
摘要: ####应用场景一般是: 页面A,用户执行操作 -->需要登录后操作 -->引导至登录页登录 -->登录成功后:1、跳转至某一指定页面 或 2、 navigateBack()上一页(页面A) ####①跳转至某一指定页面(注:没有uniapp的自动缓存,页面会刷新,可通过watch监听用户登录状态, 阅读全文
posted @ 2021-07-19 10:29 huihuihero 阅读(2286) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 28 下一页