![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
十六.工具
庚中
这个作者很懒,什么都没留下…
展开
-
工作工具之-函数封装-type篇
typeclass TypeFn { isString (o) { //是否字符串 return Object.prototype.toString.call(o).slice(8, -1) === 'String' } isNumber (o) { //是否数字 return Object.prototype.toString.call...原创 2020-02-25 02:11:58 · 143 阅读 · 0 评论 -
工作工具之-函数封装-string篇
stringclass StringFn { /** * 去除空格 * @param {str} * @param {type} * type: 1-所有空格 2-前后空格 3-前空格 4-后空格 * @return {String} */ trim (str, type) { t...原创 2020-02-25 02:11:16 · 155 阅读 · 0 评论 -
工作工具之-函数封装-storage篇
storageclass StorageFn { constructor () { this.ls = window.localStorage; this.ss = window.sessionStorage; } /*-----------------cookie---------------------*/ /*设置cooki...原创 2020-02-25 02:10:32 · 284 阅读 · 0 评论 -
工作工具之-函数封装-继续补充篇
继续补充class OtherFn { /** * [deepClone 深度克隆] * @param {[type]} obj [克隆对象] * @return {[type]} [返回深度克隆后的对象] */ deepClone (obj) { if (obj === null || typeof obj !...原创 2020-02-25 02:09:44 · 152 阅读 · 0 评论 -
工作工具之-函数封装-number篇
numberclass NumberFn { /*随机数范围*/ random (min, max) { if (arguments.length === 2) { return Math.floor(min + Math.random() * ( (max+1) - min )) }else{ r...原创 2020-02-25 02:07:43 · 766 阅读 · 0 评论 -
工作工具之-函数封装-补充篇
补充/* //////////////////////////////判断操作///////////////////////////////////*/class TypeFn { isString (o) { //是否字符串 return Object.prototype.toString.call(o).slice(8, -1) === 'String' }...原创 2020-02-25 02:06:28 · 142 阅读 · 0 评论 -
工作工具之-函数封装-http篇
http/* let url = 'http://demo.com/api' 例: ajax({ url: url, success: function(data) { } })*/function ajax(setting){ //设置参数的初始值 ...原创 2020-02-25 02:03:16 · 166 阅读 · 0 评论 -
工作工具之-函数封装-dom篇
DOMclass DomFn { $ (selector){ var type = selector.substring(0, 1); if (type === '#') { if (document.querySelecotor) return document.querySelector(selector) ...原创 2020-02-25 02:02:35 · 110 阅读 · 0 评论 -
工作工具之-函数封装-date篇
dateclass DateFn { /** * 格式化时间 * * @param {time} 时间 * @param {cFormat} 格式 * @return {String} 字符串 * * @example formatTime('2018-1-29', '{y}/{m}/{d} {h}:{i}:{s...原创 2020-02-25 02:01:44 · 165 阅读 · 0 评论 -
工作工具之-函数封装-base64篇
base64function Base64() { // private property _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; // public method for encoding this.encode ...原创 2020-02-25 02:00:52 · 183 阅读 · 0 评论 -
工作工具之--CSS封装
function/* 禁止选中文本 */.usn{ -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; -o-user-select:none; user-select:none;}/* 浮动 */.fl { float: left; }.fr { floa...原创 2020-02-25 01:53:30 · 193 阅读 · 0 评论 -
工作工具之-函数封装-array篇
数组class ArrayFn { /*判断一个元素是否在数组中*/ contains (arr, val) { return arr.indexOf(val) != -1 ? true : false; } /** * @param {arr} 数组 * @param {fn} 回调函数 * @return ...原创 2020-02-25 01:59:20 · 158 阅读 · 0 评论 -
vscode开发工具设置
id:d6ec2acfbb7fd148460e57cbe4729557设置过程:原创 2020-02-14 10:48:02 · 181 阅读 · 0 评论 -
谷歌浏览器断点调试器的介绍
原创 2019-08-30 18:25:53 · 424 阅读 · 0 评论 -
live-server(在线自动更新服务器)
1.先建好index.html文件:2.全局安装:cnpm install live-server -g3.在终端中运行:live-server4.接着它会自动打开页面,并自动刷新.原创 2019-03-20 11:32:31 · 715 阅读 · 0 评论 -
谷歌浏览器截取全屏的方法
原创 2019-02-28 15:28:19 · 2045 阅读 · 0 评论