随笔 - 21,  文章 - 0,  评论 - 0,  阅读 - 7633
  2022年6月17日
摘要: 创建长度为 n 的空数组,长度为 n 元素都是 undefined 的 数组,元素相同但长度为 n 的数组 阅读全文
posted @ 2022-06-17 09:12 令狐虫虫666 阅读(60) 评论(0) 推荐(0) 编辑
  2022年5月5日
摘要: node运行内存不够 JavaScript heap out of memory 阅读全文
posted @ 2022-05-05 19:41 令狐虫虫666 阅读(1259) 评论(0) 推荐(0) 编辑
  2022年4月8日
摘要: 需求:做一个倒计时按钮,在“发送验证码”后开始60的倒数计时。setInterval 中使用React hooks的 state 值不变 阅读全文
posted @ 2022-04-08 09:43 令狐虫虫666 阅读(560) 评论(0) 推荐(0) 编辑
  2022年1月18日
摘要: 在React 中,<Link>和<NavLink>都用来包裹<a>标签,拦截客户端向服务端发送的请求,在React-router 中自行添加/删改元素,实现SPA,Single Page Application 单页应用。效果类似VUE 中的<router-link>。 其中,<NavLink>更接 阅读全文
posted @ 2022-01-18 17:23 令狐虫虫666 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 使用两层元素,外层(wrapper)使用border-radius 和 overflow: hidden,内层使用overflow: auto; 阅读全文
posted @ 2022-01-18 10:50 令狐虫虫666 阅读(820) 评论(0) 推荐(0) 编辑
  2022年1月17日
摘要: useState 多用于设置彼此之间没有关联的states,useReducer 多用于设置彼此之间有复杂依赖关系的states (例:从API获得的系列相关states) 阅读全文
posted @ 2022-01-17 15:37 令狐虫虫666 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 当state的变化依赖于prevState时,传入一个函数而不是新变量更合理。函数式传入的变量prevState ,React可以保证它的精确性(不会被setState 的优化方式折叠)。 阅读全文
posted @ 2022-01-17 15:10 令狐虫虫666 阅读(364) 评论(0) 推荐(0) 编辑
摘要: useRef hook包裹reference type时,可以避免每次re-render时变量被认为“不同”,从而触发useEffect hook的infinite loop 阅读全文
posted @ 2022-01-17 14:40 令狐虫虫666 阅读(200) 评论(0) 推荐(0) 编辑
  2022年1月13日
摘要: CSS filter 滤镜属性(invert 转换)可以将黑白图片反色 阅读全文
posted @ 2022-01-13 17:42 令狐虫虫666 阅读(483) 评论(0) 推荐(0) 编辑
  2022年1月11日
摘要: [1, 2, 3, 4].sort(() => Math.random() - 0.5) 阅读全文
posted @ 2022-01-11 16:02 令狐虫虫666 阅读(87) 评论(0) 推荐(0) 编辑
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

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