随笔分类 -  常用/积累

摘要:for (let idx = 40; idx >0; idx--) { if (idx % 12 0) { // break; // 终止 // return; // 终止 continue; // 跳过 } console.log(idx); } 阅读全文
posted @ 2023-07-17 13:25 冰凝^ 阅读(31) 评论(0) 推荐(0) 编辑
摘要:html: <ng-template #popTpl> <div> <p>title</p> <p>content</p> </div> </ng-template> ts: @ViewChild("popTpl") popTpl; constructor(private viewRef: View 阅读全文
posted @ 2023-07-13 13:45 冰凝^ 阅读(39) 评论(0) 推荐(0) 编辑
摘要:// 双击全屏 全屏状态双击取消 window.addEventListener('dblclick', () => { if (document.fullscreenElement) { document.exitFullscreen(); } else { documnet.querySelec 阅读全文
posted @ 2023-05-06 16:55 冰凝^ 阅读(10) 评论(0) 推荐(0) 编辑
摘要:web 浏览器页面实现滚屏效果 window 对象提供了执行动画的方法 window.requestAnimationFrame() 场景:固定位置显示多项内容列表 需要自动滚屏展示 demo: /** * 设置文本滚屏效果 */ setTextScroll(): void { const ulBo 阅读全文
posted @ 2023-04-10 15:42 冰凝^ 阅读(27) 评论(0) 推荐(0) 编辑
摘要:function(str: string): string { return str.slice(0,1).toUpperCase() + str.slice(1); } 阅读全文
posted @ 2023-03-20 17:06 冰凝^ 阅读(30) 评论(0) 推荐(0) 编辑
摘要:/** * 数组转字符串 */ const arr = [1, 3, 5, 7, 9]; // 方法1 const str1 = arr.toString(); // str1: 1,3,5,7,9 // 方法2 const str2 = arr.join('**'); // str2: 1**3* 阅读全文
posted @ 2021-12-24 10:56 冰凝^ 阅读(74) 评论(0) 推荐(0) 编辑
摘要:/** * 数组删除指定项 * item: 要删除的项 * array:要执行删除项的数组 * code: 数组项的唯一字段 */ arrayRemoveItem(item, array, code?: string) { const idx = array.findIndex(ite => { r 阅读全文
posted @ 2021-12-24 10:25 冰凝^ 阅读(233) 评论(0) 推荐(0) 编辑
摘要:/** * 获取url参数 * name: 可选项,获取某参数,如果不传参将返回参数对象 */ getUrlParams(name?) { const url = window.location.href; const paramList = url.split('?')[1]?.split('&' 阅读全文
posted @ 2021-12-23 14:43 冰凝^ 阅读(27) 评论(0) 推荐(0) 编辑
摘要:i.e. 即,也就是 e.g. 例如(for example) as the name implies 顾名思义 coverage 发音:[`kʌvərɪdʒ] n:新闻报道;(书、课程学习、电视等的)信息范围,信息质量;提供的数据;覆盖范围(或方式); coverage rate:覆盖率[`kʌv 阅读全文
posted @ 2020-03-11 16:46 冰凝^ 编辑

点击右上角即可分享
微信分享提示