- 博客(5)
- 收藏
- 关注
原创 element 表格有固定列时滚动不齐有迟滞性
解决方案是继承覆盖element的Table组件,并重写Table组件的bindEvents和syncPostion方法,因为根据源代码发现,Table中的syncPostion方法可能出于性能的原因使用了防抖,我们这里就直接把防抖拿掉了,但这不是产生问题的主要原因,这个只是会导致轻微的迟滞。产生这个问题的最主要原因是:滚轮事件会自动触发滚动事件,滚动事件中自动使用了behavior: 'smooth’机制,这个机制会让滚动看起来很丝滑,但会耗费更多的性能,估计浏览器处于性能考虑导致两个滚动效果不同步了
2021-09-25 10:59:00
3342
1
原创 谷歌浏览器升级到 80 后解决拦截cookie方案
Google 将在2020年2月4号发布的 Chrome 80 版本(schedule:https://www.chromestatus.com/features/schedule)中默认屏蔽所有第三方 Cookie,即默认为所有 Cookie 加上 SameSite=Lax 属性(https://www.chromestatus.com/feature/5088147346030592),并且拒绝非Secure的Cookie设为 SameSite=None(https://www.chromestatus
2020-08-24 11:25:51
3108
5
原创 多维数组递归查找
let test = [{id:1},{id:5,children:[{id:6,children:[{id:7}]}]}] function chbehavior(arr, id) { let res; (function deepId(arr, id) { for (let a of arr) { if (a.id === id) { res = a;...
2020-08-19 18:16:44
765
1
原创 VUE封装防抖和节流
let timeout = nulllet timer = nulllet start = 0//函数防抖(debounce)export const debounce = (func, delay) => { if (timeout !== null) clearTimeout(timeout) timeout = setTimeout(func, delay)}//函数节流(Throttle)export const Throttle = (func, wait,
2020-08-10 14:25:25
961
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人