摘要:
style-resources-loader; vue-cli 阅读全文
摘要:
子串(定义):字符串中任意个连续的字符组成的子序列称为该串的子串。 /** * 通过for循环判断A是否为B的子串 * @param {String} comp - 被对比的字符串(B) * @returns {Boolean} */ String.prototype.isSubStrOf = fu 阅读全文
摘要:
1. flexbox .parent { display: flex; justify-content: center; align-items: center; width: xxxpx; height: xxxpx; } .child { width: xxxpx; height: xxxpx; 阅读全文
摘要:
function MinStack() { this.stack = []; this.helperStack = []; this.len = 0; this.helperLen = 0; } MinStack.prototype.push = function(v) { this.stack.p 阅读全文
摘要:
Array.prototype._reverse = function() { const len = this.length; const mid = Math.floor(len / 2); // l: left pointer; r: right pointer; let l = 0, r = 阅读全文
摘要:
JS数组去重 阅读全文
摘要:
encodeURIComponent可以转义除了以下字符外的任意字符: // 不转义的字符 A-Z a-z 0-9 - _ . ! ~ * ' ( ) encodeURIComponent和encodeURI 有以下几个不同点: var set1 = ";,/?:@&=+$"; // 保留字符 va 阅读全文
摘要:
CSS中的度量单位可以分为:相对长度单位、绝对长度单位 相对长度单位有:em/rem/%/vm/vh/vmin/vmax/ch/ex 绝对长度单位有:px/pt/pc/in/cm/mm/q 注:1ch(css3)的长度等于数字0在页面中呈现的可视宽度;ex表示相对于字符“x”的高度,通常为字体高度的 阅读全文
摘要:
1. 通过回调函数 <SomeComponent ref={thisComp => this.yourCompRef = thisComp} /> 2. 通过createRef函数 const currentRef = React.createRef(); <SomeComponent ref={c 阅读全文
摘要:
在 Create React App 工程中样式使用less modules 阅读全文