验证邮政编码

1
2
3
4
/**
* @param { string } value
*/
export const isPostcode = value => /^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/g.test(value);

验证中文和数字

1
2
3
4
/**
* @param { string } value
*/
export const isCHNAndEN = value => /^((?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])|(\d))+$/g.test(value);

验证火车车次

1
export const isTrainNum = value => /^[GCDZTSPKXLY1-9]\d{1,4}$/g.test(value);

验证网址

1
2
3
4
/**
* @param { string } value
*/
export const isRightWebsite = value => /^(((ht|f)tps?):\/\/)?[\w-]+(\.[\w-]+)+([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?$/g.test(value);

验证银行卡号

1
2
3
4
/**
* @param { string } value
*/
export const isAccountNumber = value => /^[1-9]\d{9,29}$/g.test(value);

验证中文姓名

1
2
3
4
/**
* @param { string } value
*/
export const isChineseName = value => /^(?:[\u4e00-\u9fa5·]{2,16})$/g.test(value);

验证英文姓名

1
2
3
4
/**
* @param { string } value
*/
export const isEnglishName = value => /(^[a-zA-Z]{1}[a-zA-Z\s]{0,20}[a-zA-Z]{1}$)/g.test(value);

验证严谨手机号

1
2
3
4
/**
* @param { string } value
*/
export const isMPStrict = value => /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-7|9])|(?:5[0-3|5-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[1|8|9]))\d{8}$/g.test(value);

验证邮箱

1
2
3
4
/**
* @param { string } value
*/
export const isEmail = value => /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/g.test(value);

验证座机号码

1
2
3
4
/**
* @param { string } value
*/
export const isLandlineTelephone = value => /\d{3}-\d{8}|\d{4}-\d{7}/g.test(value);

验证身份证号码

1
2
3
4
/**
* @param { string } value
*/
export const isIDCardNew = value => /^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}[\dXx]$/g.test(value);

验证护照

1
2
3
4
/**
* @param { string } value
*/
export const isPassport = value => /(^[EeKkGgDdSsPpHh]\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\d{7}$)/g.test(value);

验证账号是否合法,5-13位,允许字母下划线组合

1
2
3
4
/**
* @param { string } value
*/
export const isWebAccount = value => /^[a-zA-Z]\w{4,15}$/g.test(value);

验证中文/汉子

1
2
3
4
/**
* @param { string } value
*/
export const isChineseCharacter = value => /^(?:[\u3400-\u4DB5\u4E00-\u9FEA\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0])+$/g.test(value);

验证小数

1
2
3
4
/**
* @param { string } value
*/
export const isDecimal = value => /^\d+\.\d+$/g.test(value);

验证数字

1
2
3
4
/**
* @param { string } value
*/
export const isNumber = value => /^\d{1,}$/g.test(value);

验证qq号码

1
2
3
4
/**
* @param { string } value
*/
export const isQQNum = value => /^[1-9][0-9]{4,10}$/g.test(value);

验证数字和字母

1
2
3
4
/**
* @param { string } value
*/
export const isNumAndStr = value => /^[A-Za-z0-9]+$/g.test(value);

验证英文字母

1
2
3
4
/**
* @param { string } value
*/
export const isEnglish = value => /^[a-zA-Z]+$/g.test(value);

获取url参数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
* @param {*} name
* @param {*} origin
*/

export function getUrlParam(name, origin = null) {
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
let r = null;
if (origin == null) {
r = window.location.search.substr(1).match(reg);
} else {
r = origin.substr(1).match(reg);
}
if (r != null) return decodeURIComponent(r[2]);
return null;
}

获取url参数第二种

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/**
* @param {*} name
* @param {*} origin
*/
export function getUrlParams(name, origin = null) {
let url = location.href;
let temp1 = url.split('?');
let pram = temp1[1];
let keyValue = pram.split('&');
let obj = {};
for (let i = 0; i < keyValue.length; i++) {
let item = keyValue[i].split('=');
let key = item[0];
let value = item[1];
obj[key] = value;
}
return obj[name];
}

修改url参数

1
2
3
4
5
6
7
8
9
10
/**
* @param { string } paramName
* @param { string } replaceWith
*/
export function replaceParamVal(paramName,replaceWith) {
var oUrl = location.href.toString();
var re=eval('/('+ paramName+'=)([^&]*)/gi');
location.href = oUrl.replace(re,paramName+'='+replaceWith);
return location.href;
}

删除url指定的参数

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* @param { string } name
*/
export function funcUrlDel(name){
var loca =location;
var baseUrl = loca.origin + loca.pathname + "?";
var query = loca.search.substr(1);
if (query.indexOf(name)>-1) {
var obj = {};
var arr = query.split("&");
for (var i = 0; i < arr.length; i++) {
arr[i] = arr[i].split("=");
obj[arr[i][0]] = arr[i][1];
}
delete obj[name];
var url = baseUrl + JSON.stringify(obj).replace(/[\"\{\}]/g,"").replace(/\:/g,"=").replace(/\,/g,"&");
return url
}
}

获取窗口可是范围高度

1
2
3
4
5
6
7
8
9
10
export function getClientHeight() {
let clientHeight = 0;
if (document.body.clientHeight && document.documentElement.clientHeight) {
clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
}
else {
clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight;
}
return clientHeight;
}

获取窗口可是范围宽度

1
2
3
4
5
export function getPageViewWidth() {
let d = document,
a = d.compatMode == "BackCompat" ? d.body : d.documentElement;
return a.clientWidth;
}

获取窗口尺寸

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export function getViewportOffset() {
if (window.innerWidth) {
return {
w: window.innerWidth,
h: window.innerHeight
}
} else {
// ie8及其以下
if (document.compatMode === "BackCompat") {
// 怪异模式
return {
w: document.body.clientWidth,
h: document.body.clientHeight
}
} else {
// 标准模式
return {
w: document.documentElement.clientWidth,
h: document.documentElement.clientHeight
}
}
}
}

获取滚动条距离顶部的高度

1
2
3
4
export function getPageScrollTop() {
let a = document;
return a.documentElement.scrollTop || a.body.scrollTop;
}

开启/关闭全屏

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* @param {*} element
*/
export function launchFullscreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen()
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen()
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen()
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullScreen()
}
}

export function exitFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.msExitFullscreen) {
document.msExitFullscreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen()
}
}

返回当前滚动条的位置

1
2
3
4
export const getScrollPosition = (el = window) => ({
x: el.pageXOffset !== undefined ? el.pageXOffset : el.scrollLeft,
y: el.pageYOffset !== undefined ? el.pageYOffset : el.scrollTop
});

平滑滚动到页面顶部

1
2
3
4
5
6
7
export const scrollToTop = () => {
const c = document.documentElement.scrollTop || document.body.scrollTop;
if (c > 0) {
window.requestAnimationFrame(scrollToTop);
window.scrollTo(0, c - c / 8);
}
};

http 跳 https

1
2
3
export const httpsRedirect = () => {
if (location.protocol !== 'https:') location.replace('https://' + location.href.split('//')[1]);
};

检查页面底部可见

1
2
3
4
export const bottomVisible = () =>{
return document.documentElement.clientHeight + window.scrollY >=
(document.documentElement.scrollHeight || document.documentElement.clientHeight);
};

打开一个窗口

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @param { string } url
* @param { string } windowName
* @param { number } width
* @param { number } height
*/
export function openWindow(url, windowName, width, height) {
var x = parseInt(screen.width / 2.0) - width / 2.0;
var y = parseInt(screen.height / 2.0) - height / 2.0;
var isMSIE = navigator.appName == "Microsoft Internet Explorer";
if (isMSIE) {
var p = "resizable=1,location=no,scrollbars=no,width=";
p = p + width;
p = p + ",height=";
p = p + height;
p = p + ",left=";
p = p + x;
p = p + ",top=";
p = p + y;
window.open(url, windowName, p);
} else {
var win = window.open(
url,
"ZyiisPopup",
"top=" +
y +
",left=" +
x +
",scrollbars=" +
scrollbars +
",dialog=yes,modal=yes,width=" +
width +
",height=" +
height +
",resizable=no"
);
eval("try { win.resizeTo(width, height); } catch(e) { }");
win.focus();
}
}

自适应页面

1
2
3
4
5
6
7
8
9
/**
* @param { number } width
*/
export function AutoResponse(width = 750) {
const target = document.documentElement;
target.clientWidth >= 600
? (target.style.fontSize = "80px")
: (target.style.fontSize = target.clientWidth / width * 100 + "px");
}

浏览器localstorage 存储

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* 目前对象值如果是函数 、RegExp等特殊对象存贮会被忽略
* @param { String } key 属性
* @param { string } value 值
*/
export const localStorageSet = (key, value) => {
if (typeof (value) === 'object') value = JSON.stringify(value);
localStorage.setItem(key, value)
};
/**
* @param {String} key 属性
*/
export const localStorageGet = (key) => {
return localStorage.getItem(key)
};
/**
* @param {String} key 属性
*/
export const localStorageRemove = (key) => {
localStorage.removeItem(key)
};

/**
* @param {String} key 属性
* @param {*} value 存贮值
* @param { number } expire 过期时间,毫秒数
*/
export const localStorageSetExpire = (key, value, expire) => {
if (typeof (value) === 'object') value = JSON.stringify(value);
localStorage.setItem(key, value);
setTimeout(() => {
localStorage.removeItem(key)
}, expire)
};

sessionStorage 存储

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @param {String} key 属性
* @param {*} value 值
*/
export const sessionStorageSet = (key, value) => {
if (typeof (value) === 'object') value = JSON.stringify(value);
sessionStorage.setItem(key, value)
};
/**
* @param {String} key 属性
*/
export const sessionStorageGet = (key) => {
return sessionStorage.getItem(key)
};
/**
* @param {String} key 属性
*/
export const sessionStorageRemove = (key) => {
sessionStorage.removeItem(key)
};
/**
* @param {String} key 属性
* @param {*} value 存贮值
* @param {String} expire 过期时间,毫秒数
*/
export const sessionStorageSetExpire = (key, value, expire) => {
if (typeof (value) === 'object') value = JSON.stringify(value);
sessionStorage.setItem(key, value);
setTimeout(() => {
sessionStorage.removeItem(key)
}, expire)
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @param {String} key 属性
* @param {*} value 值
* @param { String } expire 过期时间,单位天
*/
export const cookieSet = (key, value, expire) => {
const d = new Date();
d.setDate(d.getDate() + expire);
document.cookie = `${key}=${value};expires=${d.toUTCString()}`
};
/**
* @param {String} key 属性
*/
export const cookieGet = (key) => {
const cookieStr = unescape(document.cookie);
const arr = cookieStr.split('; ');
let cookieValue = '';
for (let i = 0; i < arr.length; i++) {
const temp = arr[i].split('=');
if (temp[0] === key) {
cookieValue = temp[1];
break
}
}
return cookieValue
};
/**
* @param {String} key 属性
*/
export const cookieRemove = (key) => {
document.cookie = `${encodeURIComponent(key)}=;expires=${new Date()}`
};

截流和防抖

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* @param { function } func 函数
* @param { number } wait 延迟执行毫秒数
* @param { number } type 1 表时间戳版,2 表定时器版
*/
export function throttle(func, wait ,type) {
let previous, timeout;
if(type===1){
previous = 0;
}else if(type===2){
timeout = null;
}
return function() {
let context = this;
let args = arguments;
if(type===1){
let now = Date.now();

if (now - previous > wait) {
func.apply(context, args);
previous = now;

}
}else if(type===2){
if (!timeout) {
timeout = setTimeout(() => {

timeout = null;
func.apply(context, args)
}, wait)
}
}

}
}

/**
* @param { function } func
* @param { number } wait 延迟执行毫秒数
* @param { boolean } immediate true 表立即执行,false 表非立即执行
*/
export function debounce(func,wait,immediate) {
let timeout;
return function () {
let context = this;
let args = arguments;

if (timeout) clearTimeout(timeout);
if (immediate) {
let callNow = !timeout;
timeout = setTimeout(() => {
timeout = null;
}, wait);
if (callNow) func.apply(context, args)
}
else {
timeout = setTimeout(() => {
func.apply(context, args)
}, wait);
}
}
}

判断数据类型

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
* @param {*} target
*/
export function type(target) {
let ret = typeof(target);
let template = {
"[object Array]": "array",
"[object Object]":"object",
"[object Number]":"number - object",
"[object Boolean]":"boolean - object",
"[object String]":'string-object'
};

if(target === null) {
return 'null';
}else if(ret == "object"){
let str = Object.prototype.toString.call(target);
return template[str];
}else{
return ret;
}
}

生成指定范围随机数

1
2
3
4
5
6
/**
* @param { number } min
* @param { number } max
*/
export const RandomNum = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
export const RandomNum = (min,max) => Math.floor(Math.random() * (max-min +1)) +min

数组乱序

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
* @param {array} arr
*/
export function arrScrambling(arr) {
let array = arr;
let index = array.length;
while (index) {
index -= 1;
let randomIndex = Math.floor(Math.random() * index);
let middleware = array[index];
array[index] = array[randomIndex];
array[randomIndex] = middleware
}
return array
}

数组交集

1
2
3
4
5
/**
* @param { array} arr1
* @param { array } arr2
*/
export const similarity = (arr1, arr2) => arr1.filter(v => arr2.includes(v));

数组中某元素出现的次数

1
2
3
4
5
6
7
/**
* @param { array } arr
* @param {*} value
*/
export function countOccurrences(arr, value) {
return arr.reduce((a, v) => v === value ? a + 1 : a + 0, 0);
}

加法 减法 乘法 除法 解决精度问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* @param { number } arg1
* @param { number } arg2
*/
export function add(arg1, arg2) {
let r1, r2, m;
try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
m = Math.pow(10, Math.max(r1, r2));
return (arg1 * m + arg2 * m) / m
}

/**
* @param { number } arg1
* @param { number } arg2
*/
export function sub(arg1, arg2) {
let r1, r2, m, n;
try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
m = Math.pow(10, Math.max(r1, r2));
n = (r1 >= r2) ? r1 : r2;
return Number(((arg1 * m - arg2 * m) / m).toFixed(n));
}

/**
* @param { number } num1
* @param { number } num2
*/
export function division(num1,num2){
let t1,t2,r1,r2;
try{
t1 = num1.toString().split('.')[1].length;
}catch(e){
t1 = 0;
}
try{
t2=num2.toString().split(".")[1].length;
}catch(e){
t2=0;
}
r1=Number(num1.toString().replace(".",""));
r2=Number(num2.toString().replace(".",""));
return (r1/r2)*Math.pow(10,t2-t1);
}

/**
* @param { number } num1
* @param { number } num2
*/
export function mcl(num1,num2){
let m=0,s1=num1.toString(),s2=num2.toString();
try{m+=s1.split(".")[1].length}catch(e){}
try{m+=s2.split(".")[1].length}catch(e){}
return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
}

尾递归

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
* @param { function } f
*/
export function tco(f) {
let value;
let active = false;
let accumulated = [];

return function accumulator() {
accumulated.push(arguments);
if (!active) {
active = true;
while (accumulated.length) {
value = f.apply(this, accumulated.shift());
}
active = false;
return value;
}
};
}

生成随机数

1
2
3
4
5
6
7
8
export function randomNumInteger (min,max) {
switch(arguments.length){
// parseInt方法两个参数 第一个是字符串string, 第二个是2-36之间的进制数
case 1: return parseInt(Math.random() *min+1,10);
case 2: return parseInt(Math.random() *(max-min+1)+min,10);
default: return 0;
}
}

去除空格

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* @param {string} str 待处理的字符串
* @param {number} type 去除空格类型 1:所有的空格。2:前后空格 3:前空格。4:后空格。默人为1
*/
export function clearTrim(str,type){
if (type && type !== 1 && type !== 2 && type !== 3 && type !== 4) return;
switch(type){
case 1:
return str.replace(/\s/g, "");
case 2:
return str.replace(/(^\s)|(\s*$)/g, "");
case 3:
return str.replace(/(^\s)/g, "");
case 4:
return str.replace(/(\s$)/g, "");
default:
return str;
}
}

大小写转换

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/**
* @param { string } str 待转换的字符串
* @param { number } type 1-全大写 2-全小写 3-首字母大写 其他-不转换
*/

export function turnCase(str, type) {
switch (type) {
case 1:
return str.toUpperCase();
case 2:
return str.toLowerCase();
case 3:
return str[0].toUpperCase() + str.substr(1).toLowerCase();
default:
return str;
}
}

随机16进制颜色

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/**
* 方法一
*/
export function hexColor() {

let str = '#';
let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F'];
for (let i = 0; i < 6; i++) {
let index = Number.parseInt((Math.random() * 16).toString());
str += arr[index]
}
return str;
}
/**
* 方法二
*/
export const randomHexColorCode = () => {
let n = (Math.random() * 0xfffff * 1000000).toString(16);
return '#' + n.slice(0, 6);
};

防止xss攻击

1
2
3
4
5
6
7
8
9
10
11
12
13
export const escapeHTML = str =>{
str.replace(
/[&<>'"]/g,
tag =>
({
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
"'": '&#39;',
'"': '&quot;'
}[tag] || tag)
);
};

检测移动设备

1
2
3
export const detectDeviceType = () => { 
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? 'Mobile' : 'Desktop';
};

日期年月日

1
2
3
4
5
6
7
8
9
export const getDate = (n)=>{
let date = new Date()
date.setDate(date.getDate()+n)
let year = date.getFullYear()
let month = date.getDate()
month = month<10 ?'0'+month : month
day = day<10 ? '0'+day: day
return year + '-' + month + '-' + day
}
相关文章
评论
分享
  • 城市三联

    123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263...

    城市三联
  • 老式浏览器是否支持字符串比较正则u修饰符字符模式

    检测当前引擎是否支持u修饰符12345678function hasRegExpU(){ try{ var pattern = new RegExp('.',u); return ...

    老式浏览器是否支持字符串比较正则u修饰符字符模式
  • 随机十六进制颜色

    const randomHexColorCode => () { let n = (Math.random() * 0xfffff * 1000000).toString(16); ret...

    随机十六进制颜色
  • 各种去重的效率

    1. set方法去重123function unique(){ return Array.from(new Set(this))} 1234567const arr =[]for (let i = 0; i ...

    各种去重的效率
  • 手写bind和call及apply

    自定义bind和call及apply重要的是this和参数```bash js// 设置公共this方法let pubContext = funtion(){return this} Function.prototype._bind ...

    手写bind和call及apply
  • 全网灰暗效果

    css处理全网灰暗css12345678filter: grayscale(100%); -webkit-filter: grayscale(100%); -moz-filter: grayscale(100%); -ms...

    全网灰暗效果
  • 观察者模式和发布订阅模式

    观察者模式和发布订阅模式观察者模式:是指一个对象(subject)维持一个依赖列表Observer,当主题状态发生变化的时候,会通知观察者集合。发布和观察者都能看到对方都知道对方的存在。比如事件触发。发布订阅模式:观察者和订阅者关联。...

    观察者模式和发布订阅模式
  • vue请求封装

    js1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162...

    vue请求封装
  • 面试题目

    vue-loader 的原理是什么

    面试题目
  • 2019年终总结

    整体来说波折不断,时间很紧,规划的比较粗糙,心力突出分散,计划崩溃1.跳槽较多,浪费了很多时间和金钱。压缩了其他任务的时间2.冲突较多,心情烦躁多变。3.健身计划耽搁,目标120变140斤,然而还是原地踏步4.学习技能加深较慢,js基...

    2019年终总结
Please check the comment setting in config.yml of hexo-theme-Annie!