摘要: 逻辑如图 代码(栈的类看上一篇): function parentheseChecker(symbols){ const stack = new Stack(); const opens='([{'; const closes=')]}'; let balanced = true; let inde 阅读全文
posted @ 2022-01-13 15:07 she_will 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 1、定义一个栈的类 class Stack{ constructor(){ this.items=[] } // 从栈顶添加元素 push(ele){ this.items.push(ele) } // 从栈移除元素 pop(){ return this.items.pop() } // 查看栈顶元 阅读全文
posted @ 2022-01-12 17:18 she_will 阅读(193) 评论(0) 推荐(0) 编辑
摘要: react版本 按1920/1080的比例进行缩放比例的换算,本地屏幕的宽高取innerWidth和innerHeight 在需要进行大屏适配的页面添加如下代码,大屏内部的计算单位直接使用px就可以了 //1、计算scale值,并存储在state中 getScale = () => { const 阅读全文
posted @ 2021-07-22 14:41 she_will 阅读(721) 评论(0) 推荐(0) 编辑
摘要: tooltip是一个DOM,并不是在config中配置的。。。。。。 :global(.g2-tooltip) { background: #717bb8 !important; box-shadow: #fff 0px 0px 0px !important; opacity: 1 !importa 阅读全文
posted @ 2021-07-09 10:44 she_will 阅读(1757) 评论(0) 推荐(0) 编辑
摘要: .video-list::-webkit-scrollbar { /*滚动条整体样式*/ width: 6px; /*高宽分别对应横竖滚动条的尺寸*/ height: 6px; } .video-list::-webkit-scrollbar-thumb { /*滚动条里面小方块*/ border- 阅读全文
posted @ 2021-07-08 16:02 she_will 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 可以修改line-clamp的属性值 overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; /* autoprefixer: off */ -webkit-box-orient: 阅读全文
posted @ 2021-07-06 10:56 she_will 阅读(156) 评论(0) 推荐(0) 编辑
摘要: background-image: linear-gradient(to top, rgba(25, 26, 50, 0.6), rgba(25, 26, 50, 0.6)), url(../../../../assets/img/dark/num_back2.png); 阅读全文
posted @ 2021-06-30 16:41 she_will 阅读(655) 评论(0) 推荐(0) 编辑
摘要: 关于reduce arr.reduce(callback,init) reduce为遍历数组,为每一个元素执行回调函数,回调函数中接收四个参数 prev:上一次回调返回的值,或者是提供的初始值init(如果Init存在,不存在回调函数会从下标为1的元素开始执行); cur:当前被处理的元素; ind 阅读全文
posted @ 2021-05-06 15:49 she_will 阅读(1578) 评论(0) 推荐(0) 编辑
摘要: 有时候前端需要实现数据跳动效果 const $setJumpNum = (startNum,targetNum,time=1,selector) =>{ var dom = document.querySelector(selector) var originNum = startNum var s 阅读全文
posted @ 2021-04-01 14:52 she_will 阅读(769) 评论(0) 推荐(0) 编辑
摘要: js模拟vue的双向绑定 1、处理数据有getter和setter 2、数据改变 触发set 3、set通知watcher监听 4、watcher监听更新页面 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta n 阅读全文
posted @ 2020-08-05 15:12 she_will 阅读(460) 评论(0) 推荐(0) 编辑