上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: vue build --target wc --name componentName src/components/xxxxxx.vue componentName:web-component 组件名字,自己取src/components/xxxxxx.vue:vue组件路径 阅读全文
posted @ 2021-12-17 13:57 青云码上 阅读(659) 评论(0) 推荐(0)
摘要: 普通去重 [...new Set(arr)] 根据对象属性值去重 function unique(arr,u_key) { let map = new Map() arr.forEach((item,index)=>{ if (!map.has(item[u_key])){ map.set(item 阅读全文
posted @ 2021-12-13 15:44 青云码上 阅读(202) 评论(0) 推荐(0)
摘要: Element 接口的scrollIntoView()方法会滚动元素的父容器,使被调用scrollIntoView()的元素对用户可见。 语法 element.scrollIntoView(); // 等同于element.scrollIntoView(true) element.scrollInt 阅读全文
posted @ 2021-09-28 11:21 青云码上 阅读(178) 评论(0) 推荐(0)
摘要: 匹配中文:/[\u4e00-\u9fa5]/ 匹配表情:/(\ud83c[\udf00-\udfff])|(\ud83d[\udc00-\ude4f\ude80-\udeff])|[\u2600-\u2B55]/ 匹配手机号:/^[1][3,4,5,6,7,8,9][0-9]{9}$/ 匹配座机:/ 阅读全文
posted @ 2021-08-30 20:46 青云码上 阅读(135) 评论(0) 推荐(0)
摘要: index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <titl 阅读全文
posted @ 2021-08-18 11:10 青云码上 阅读(1074) 评论(0) 推荐(0)
摘要: .active { animation-play-state: running; } .paused { animation-play-state: paused; } IOS低版本机型不支持animation-play-state 兼容写法: @supports not(animation-pla 阅读全文
posted @ 2021-05-19 15:45 青云码上 阅读(212) 评论(0) 推荐(0)
摘要: 原因: 在苹果手机上, transform 变换的时候会让 z-index “临时失效”,其实并非 z-index 失效了,只是 z-index 被用在不同的 stacking context 上,而非在默认的 context 上同等地比较层级了。所以 DOM 在 transform 的工程中,DO 阅读全文
posted @ 2021-05-13 19:39 青云码上 阅读(892) 评论(0) 推荐(0)
摘要: let arr = [1,[2,3,[4]],5,6,[7,[8],[9,10,[11],12]]]; Array.prototype.myFlat = function(n){ let newArr = []; this.forEach(item=>{ if(Array.isArray(item) 阅读全文
posted @ 2021-05-05 17:14 青云码上 阅读(140) 评论(0) 推荐(0)
摘要: // 要模拟promise的构造函数 function MyPromise(fn) { this.data = null; // 要resolve的数据 this.err = null; // 要reject的数据 this.resolveCallback = null; // 存放resolve的 阅读全文
posted @ 2021-04-28 21:34 青云码上 阅读(200) 评论(0) 推荐(0)
摘要: 今天写微信小程序遇到一个问题:给page加 150rpx 的 padding-bottom 值,我考虑到 iphone X 系列的底部黑线,参考我之前写的css属性——env()和constant()设置安全区域;所以我这样写: page{ padding-bottom: calc( constan 阅读全文
posted @ 2021-04-21 19:58 青云码上 阅读(3104) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页