摘要: String.prototype.byteLength = function() { //获取字符串的字节数 var b = 0, l = this.length; //初始化字节数递加变量并获取字符串参数的字符个数 if(l) { //如果存在字符串,则执行计划 for(var i = 0; i 阅读全文
posted @ 2020-01-10 16:48 zaijinyang 阅读(1298) 评论(0) 推荐(1) 编辑
摘要: html: <button>Button</button> css: button { min-width: 100px; max-width: 150px; min-height: 40px; border: 0; outline: 0; color: white; background: #ee 阅读全文
posted @ 2020-01-10 16:03 zaijinyang 阅读(443) 评论(0) 推荐(0) 编辑
摘要: html: <button class="button">Button</button> css: .button { display: inline-block; padding: 1em 2em; background-color: #ff0081; color: #fff; border-ra 阅读全文
posted @ 2020-01-10 15:39 zaijinyang 阅读(458) 评论(0) 推荐(1) 编辑
摘要: 1、过滤唯一值: const arr = [1, 1, 2, 3, 5, 5, 1] const uniqueArr = [...new Set(arr)] console.log(uniqueArr) // [1,2,3,5] 其中的Set为es6新增属性 2、与或运算: 其实与或运算的精简之处就 阅读全文
posted @ 2020-01-10 14:52 zaijinyang 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 在我的vue项目中出现了如图所示的问题: 但是在之前的项目从未遇到过,于是百度了许多,网上介绍的都是intsall @babel/plugin-syntax-dynamic-import 并且在..babelrc中引入的方法,但是在vueCli3.0之后的版本根本不存在这个文件,其实它是变成了bab 阅读全文
posted @ 2020-01-10 09:45 zaijinyang 阅读(1773) 评论(0) 推荐(0) 编辑