![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
随笔
β GO
起风了,唯有努力生存
展开
-
缓行函数收集
// t - process 已消耗时间 // b - 起始值 // c - 数值差的绝对值 // d - duration 总需求时间 easeOutExpo = (t, b, c, d) => // -Math.pow(2, -10 * t / d) + 1 指数函数 (0-1) c * (-Math.pow(2, -10 * t / d) + 1) * 1024 / 1023 + b easeOutBounce = (t, b, c, d) =>...原创 2022-02-28 16:46:28 · 146 阅读 · 0 评论 -
(0, fn)改变this指向
今天读elementui源码时发现一个有意思的写法 (0, _dom.on)(el, 'mousedown', function (e) { if (e.button !== 0) return; startTime = Date.now(); (0, _dom.once)(document, 'mouseup', clear); clearInterval(interval); interval = setInterval(handle原创 2021-12-02 11:43:32 · 632 阅读 · 0 评论 -
vite遇到的坑
1. process is not defined项目中引入了path,,想用它的resolve方法,但是报process is not defined的错误发现是因为path方法用到了platform属性,但是在vite2中process为undefined那也就是说,所有用到process属性的库都会有这个问题在网上找到了答案,参考链接在最下面export default defineConfig({ // ... define: { 'process.env'原创 2021-08-31 16:07:07 · 1942 阅读 · 1 评论 -
连续重复请求的解决方案
有一个input输入发请求筛选员工的功能由于前一次的请求耗时远大于后一次请求,导致页面渲染内容错误,本应该渲染最后一次的结果却被第一次请求的结果覆盖解决方案: 原理:相同请求在没有返回值之前再次调用时进行拦截...原创 2021-08-27 11:43:22 · 1519 阅读 · 0 评论