摘要: a对象有个属性b,b也是一个对象有个属性c,或a对象直接有个属性c,此时不管属性b存不存在,我们都要取属性c,此时如果用a.b.c就会报错。 此时就需要用a?.b.c,这样属性b就是可选属性,没有它也可以 阅读全文
posted @ 2021-12-29 18:31 Re。 阅读(36) 评论(0) 推荐(0)
摘要: const q = {}; location.search.replace(/([^?&=]+)=([^&]+)/g,(_,k,v)=>q[k]=v); console.log(q); 阅读全文
posted @ 2021-12-29 17:55 Re。 阅读(42) 评论(0) 推荐(0)
摘要: 1、用一个色块通过定位盖上去 2、将子级元素调大,父级元素使用overflow-hidden截掉滚动条部分。 阅读全文
posted @ 2021-12-29 16:52 Re。 阅读(102) 评论(0) 推荐(0)
摘要: 一行文本超出... overflow: hidden; text-overflow:ellipsis; white-space: nowrap; 多行文本超出... display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-cl 阅读全文
posted @ 2021-12-29 16:45 Re。 阅读(60) 评论(0) 推荐(0)
摘要: 元素自身定位 div { width: 100px; height: 100px; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; } 或div { width: 100px; height: 100px 阅读全文
posted @ 2021-12-29 16:41 Re。 阅读(26) 评论(0) 推荐(0)
摘要: 给一个div加上类 .triangle { width: 0; height: 0; border: 5px solid transparent; border-left-color: red; } 阅读全文
posted @ 2021-12-29 16:32 Re。 阅读(52) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-12-09 15:25 Re。 阅读(22) 评论(0) 推荐(0)
摘要: getNowTime() { var date = new Date(); this.year = date.getFullYear(); this.month = date.getMonth() + 1; this.date = date.getDate(); this.hour = date.g 阅读全文
posted @ 2021-11-24 11:24 Re。 阅读(325) 评论(0) 推荐(0)
摘要: dataZoom:[ { type: 'slider', maxValueSpan:5,//显示数据的条数(默认显示10个) show: true, yAxisIndex: [0], left: '93%', //滑动条位置 start:100,//默认为0 end: 70,//默认为100 ori 阅读全文
posted @ 2021-11-22 15:18 Re。 阅读(3627) 评论(0) 推荐(0)
摘要: var clone =JSON.parse(JSON.stringify(arr))弊端:只能拷贝Number, String, Boolean, Array, 扁平对象,即那些能够被 JSON 直接表示的数据结构。 ; 阅读全文
posted @ 2021-11-15 16:47 Re。 阅读(110) 评论(0) 推荐(0)