摘要: 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)