摘要: @charset "UTF-8"; // px单位转成vw单位 @function px2vw($size: 14px, $width: 375px) { @if (type-of($size) == "number" and unit($size) == "px") { @return $size 阅读全文
posted @ 2019-08-22 17:29 前端小厨-美食博主 阅读(2538) 评论(0) 推荐(0) 编辑
摘要: //验证数据是否不为空(空值时返回false,null、undefined、空字符串、空数组、空对象都被设定为空)export const isNotEmpty = value => { switch (typeof value) { case "undefined": { return false 阅读全文
posted @ 2019-08-22 15:04 前端小厨-美食博主 阅读(866) 评论(0) 推荐(0) 编辑
摘要: json2params(json, slice = '&') { return Object.keys(json) .reduce((acc, item) => { return String(acc) + item + '=' + json[item] + slice; }, '') .slice 阅读全文
posted @ 2019-08-22 14:59 前端小厨-美食博主 阅读(1319) 评论(0) 推荐(0) 编辑