Skip to content

这里存放的是平时常用到的方法集合,以及偶尔想到的方法

License

Notifications You must be signed in to change notification settings

F-happy/nuts-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nuts-util

npm npm npm

这里存放的是平时常用到的方法集合,以及偶尔想到的方法。

这里的所有方法都是基于 ES6 的语法,需要预编译后才能使用。

安装方法:

$ npm install --save-dev nuts-util

已有方法:

  • jsonp: jsonp 请求方法。
  • getURL: 获取 URL 参数。
  • cleanLayout: 清除国产手机怪异布局的方法。
  • addCNZZ: 为页面添加 cnzz 监听。
  • regexp: 正则相关方法。
  • replaceAll: 替换字符串。
  • trim: 清除字符串左右空格。
  • dom: 一些 dom 元素的基本方法。
  • setCook: 添加 cookie。
  • getCook: 获取 cookie。
  • event: 一个简单的事件工具。
  • Interpreter: 一个统计元素路径的解析器。
  • detectVisible: js 防抖动节流器
  • promise_finally_polyfill: promise finally 的补丁
  • textShort: 字符串截取函数
  • timeoutPromise: fetch 设置超时方法
  • assign: Object.assign 的 Polyfill
  • camelize: 用于 css 的 camalCase 转换
  • dasherize: 用于 css 的 camalCase 逆转换
  • is_driver: 前端的一些设备判断代码
  • commafy: js 实现千分符

PS:

具体使用方法请看对应文件中的说明或者注释。

About

这里存放的是平时常用到的方法集合,以及偶尔想到的方法

Resources

License

Stars

Watchers

Forks

Packages

No packages published