09 2022 档案
摘要:示例: const [count,setCount]=useState(0) 简单的onclick事件中,setCount(1)后紧接着输出或者使用,则输出的值还是0 原因: setState会导致页面刷新,(useRef不会)页面刷新的时候会把当前周期的函数执行完,之后进入下一个周期,因此oncl
阅读全文
摘要:1.数据排序:(展示玫瑰状) data: [ { value: 100, name: 'Direct' }, { value: 300, name: 'Email' }, { value: 400, name: 'Union Ads' }, { value: 200, name: 'Video Ad
阅读全文
摘要:父盒子元素里包含一个子盒子元素,给子盒子元素一个垂直外边距margin-top,父盒子元素也会跟着往下走margin-top的值,而子盒子元素和父盒子元素的边距则没有发生变化。 W3C规范中有这么一句话: In this specification, the expression collapsin
阅读全文
摘要:官方文档说明书 官方示例 1.安装 heatmapjs // NPM npm i heatmapjs // 或者 yarn yarn add heatmapjs 2.导入h337 import h337 from 'heatmapjs'; 3.定义全局变量(在react中可用useRef做一个集合来
阅读全文
摘要:一般都用自定义的前进后退按钮: <!-- 导航按钮 --> <div class="arrowCard swiper-button-prev"> <img src="assets/arrow01.svg" alt="云智慧" /> </div> <div class="arrowCard swipe
阅读全文
摘要:对图片进行剪切,保留原始比例: img.a { width: 200px; height: 400px; object-fit: cover; } 标签定义及使用说明 object-fit 属性指定元素的内容应该如何去适应指定容器的高度与宽度。 object-fit 一般用于 img 和 video
阅读全文
摘要:如果如果需要计算圆的相关数值,需要用到:a(对边),b(临边),c(斜边),角A 2、JS知识: Math.sin(x) 和 Math.cos(x) 中的x是弧度,不是角度,所以需要用到: 公式(角度转弧度):弧度 = 2*π / 360 * 角度 (π / 180 * 角度) 简化到实用中: 求圆
阅读全文