工具类库
工具类库
huangpb0624
这个作者很懒,什么都没留下…
展开
-
Moment.js 日期处理类库(弃用,用 Day.js 代替)
以下笔记针对v2.10.6 版本一、安装 npm install moment —save二、Moment 汉化 1. 全局汉化 moment.locale('zh-cn') 2. 局部汉化 moment().locale(‘zh-cn’).format(‘h:mm:ss a’) //5:00:22 下午 ...原创 2019-07-07 16:49:23 · 1487 阅读 · 0 评论 -
query-string 和 qs 包对比
安装npm i --save-dev query-string常用API1. qs.parse(string, [options])import qs from 'query-string';location.search // ?name=jimlocation.hash // #token=123qs.parse('?name=jim') // {name:...原创 2018-12-06 11:33:24 · 10206 阅读 · 0 评论 -
sortablejs — 强大的拖拽库
Sortable.js是一款优秀的js拖拽库,支持ie9及以上版本ie浏览器和现代浏览器,也可以运行在移动触摸设备中。不依赖jQuery。支持 Meteor、AngularJS、React、Vue、Knockout框架和任何CSS库,如Bootstrap、Element UI。你可以用来拖拽div、table等元素。一、sortablejs 最基本的示例<div id="itxst"> <div data-id="a">item 1</div> <原创 2021-09-29 00:10:34 · 16142 阅读 · 3 评论 -
Reqwest 使用教程
APIreqwest('path/to/html', function (resp) { qwery('#content').html(resp)})reqwest({ url: 'path/to/html' , method: 'post' , data: { foo: 'bar', baz: 100 } , success: function (resp) { ...转载 2017-12-11 16:02:03 · 21905 阅读 · 5 评论 -
Fetch 使用教程
window 自带了window.fetch方法, 在最新版的 Firefox 和 Chrome 中已经提供支持,其他浏览器还有兼容性问题,要做兼容性处理。一、fetch 安装为了解决fetch 的兼容性,我们使用 Fetch Polyfill 的版本 whatwg-fetch。npm install --save whatwg-fetchimport 'whatwg-fe...原创 2018-03-11 23:49:02 · 20394 阅读 · 3 评论