utils6
v1.1.0
Published
utils
Downloads
8
Readme
formatNumber
toFixed
解决Number.toFixed四舍五入的问题toMoney
转化为金额格式,带有千位分隔符toLocal
转化为本地格式,带有单位
queryString
parse
解析url参数stringify
将对象转化为url参数
storage
ls
localStorage的封装ss
sessionStorage的封装localStore
localStorage带encode的封装sessionStore
sessionStorage带encode的封装getStorage
获取默认的storagesetStorage
设置默认的storageremoveStorage
清空默认的storage
templateUrl
var obj = { id: '1', type: 'edit', age: 123 };
template`/home/${'id'}/detail/${'type'}`.toStringURL(obj); // ==> /home/1/detail/edit
template`/home/${'id'}/detail/${'type'}`.getKeys(); // ==> ['id', 'type']
template`/home/${'id'}/detail/${'type'}`.getRaw(); // ==> '/home/{id}/detail/{type}'
template`/home/${'id'}/detail/${'type'}`.getOtherData(obj); // ==> { age: 123 }
index
isMobileOrPc
判断是否是移动端isIE
是否在ie浏览器getBytes
返回字节types
判断类型prefix
react写class前缀的封装