silver-util
v0.0.4
Published
常用的函数处理集合
Downloads
5
Readme
silver-util
silver-util
Features
- 样式示例:
demo
https://g.alicdn.com/silvermine/silver-util/0.0.4/demo/index.html
Installation
- npm install silver-util
Usage
- script 标签引入
<script src="https://g.alicdn.com/silvermine/silver-util/{version}/index.min.js"></script>
- import or require
- 首先
npm install silver-util
import Util from 'silver-util
或者const Util = require('silver-util')
- 首先
jsdoc 接口页面
API
getCookie(name)
example:
Util.getCookie("user");
setCookie(name,value,days)
example:
Util.setCookie("user","xiaowei",30);
delCookie(name)
example:
Util.delCookie("user");
isArray(value)
example:
Util.isArray([1,2,3]);
isNumber(value)
example:
Util.isNumber(3);
isFunction(value)
example:
Util.isFunction(function(){ });
isNumber(value)
example:
Util.isNumber(3);
isObject(value)
example:
Util.isObject({});
isString(value)
example:
Util.isString('xiao');
isBoolean(value)
example:
Util.isBoolean(true);
hexToDec(value)
example:
Util.hexToDec('%8885');
addZero(value)
example:
Util.addZero(4);
getParameter(value)
example:
Util.getParameter("token");
animate(start, end, func, time, cb)
example:
Util.animate(0,100,function(x){},20000,function(){});
jsonp(url, data, success, error)
example:
Util.jsonp('//chaoshi.tmall.com/site/getSiteInfo.htm',{a:1,b"2"},function(data){},function(data){});