diff --git a/404.html b/404.html new file mode 100644 index 0000000..07b8d65 --- /dev/null +++ b/404.html @@ -0,0 +1,19 @@ + + + + + + Zzongke + + + + + + + + + +
+ + + diff --git a/Hooks/usePromiseReadyFn.html b/Hooks/usePromiseReadyFn.html new file mode 100644 index 0000000..a292d7c --- /dev/null +++ b/Hooks/usePromiseReadyFn.html @@ -0,0 +1,129 @@ + + + + + + usePromiseReadyFn | Zzongke + + + + + + + + + +

usePromiseReadyFn

12/2/2023 Hooks

# usePromiseReadyFn

等待数据请求完再接受数据

const sleepFn = (sleep:number):Promise<number[]> => {
+  return new Promise(resolve => {
+    setTimeout(()=>{
+      resolve([1,2,3])
+    },sleep)
+  })
+}
+
+const usePromiseReadyFn = () =>{
+  let resolveResolve = null;
+
+  const promiseResolveFn = new Promise(resolve => {
+    resolveResolve = resolve;
+  })
+
+  const promiseReadyFn = (cb:()=>void) =>{
+    promiseResolveFn.then(()=>{
+      cb();
+    })
+  }
+
+  return {
+    promiseResolveFn,
+    promiseReadyFn
+  }
+}
+
+
+// Demo
+const {promiseResolveFn,promiseReadyFn} = usePromiseReadyFn;
+
+export const onReadyFn = promiseReadyFn;
+
+const request = async() =>{
+  await Promise.all([sleepFn(1000),sleepFn(3000),sleepFn(2000)])
+  promiseResolveFn();
+}
+
+// 其它地方需要用到上面执行完之后才执行获取到的数据
+import {onReadyFn} from "*";
+
+onReadyFn(()=>{
+  console.log("Ready")
+})
+
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
Last Updated: 12/2/2023, 1:01:38 PM
+ + + diff --git "a/Javascript/JavaScript\346\225\260\347\273\204\347\232\204\345\270\270\347\224\250\346\226\271\346\263\225\346\234\211\345\223\252\344\272\233.html" "b/Javascript/JavaScript\346\225\260\347\273\204\347\232\204\345\270\270\347\224\250\346\226\271\346\263\225\346\234\211\345\223\252\344\272\233.html" new file mode 100644 index 0000000..82de9ef --- /dev/null +++ "b/Javascript/JavaScript\346\225\260\347\273\204\347\232\204\345\270\270\347\224\250\346\226\271\346\263\225\346\234\211\345\223\252\344\272\233.html" @@ -0,0 +1,170 @@ + + + + + + JavaScript数组的常用方法有哪些 | Zzongke + + + + + + + + + +

JavaScript数组的常用方法有哪些

3/30/2022 JavaScript

JavaScript数组的常用方法有哪些

# 一、操作方法


数组基本操作可以归纳为 增、删、改、查,需要留意的是哪些方法会对原数组产生影响,哪些方法不会

下面对数组常用的操作方法做一个归纳

下面前三种是对原数组产生影响的增添方法,第四种则不会对原数组产生印象

  • push()
  • unshift()
  • splice()
  • concat()

push()

push()方法接受任意数量的参数,并将它们添加到数组末尾,返回数组的最新长度

const colors = []; //创建一个数组
+const count = colors.push("red", "green"); //从数组末尾传入两项
+console.log(`count:${count}`);
+
1
2
3

unshift()

unshift()在数组开头添加任意多个值,然后返回新的数组长度

const colors = new Array(); //创建一个数组
+const count = colors.unshift("red", "green"); //从数组开头传入两项
+console.log(`count:${count}`);
+
1
2
3

splice()

splice()传入三个参数,分别是开始位置、0(要删除的元素数量)、插入的元素,返回空数组

const colors = ["red", "green", "blue"];
+const removed = colors.splice(1, 0, "yellow", "orange");
+console.log(colors); // red,yellow,orange,green,blue
+console.log(removed); // []
+
1
2
3
4

concat()

concat()首先会创建一个当前数组的副本,然后再把它的参数添加到副本末尾,最后返回这个新构建的数组,不会影响原始数组

const colors = ["red", "green", "blue"];
+const colors2 = colors.concat("yellow", ["black", "brown"]);
+console.log(colors); // ["red", "green","blue"]
+console.log(colors2); // ["red", "green", "blue", "yellow", "black", "brown"]
+
1
2
3
4

下面三种都会影响原数组,最后一项不影响原数组:

  • pop()
  • shift()
  • splice()
  • slice()

pop()

pop()方法用于删除数组的最后一项,同时减少数组的 length 值,返回被删除的项

const colors = ["red", "green"];
+const item = colors.pop(); // 取得最后一项
+console.log(item); // green
+console.log(colors.length); // 1
+
1
2
3
4

shift()

shift()方法用于删除数组的第一项,同时减少数组的 length 值,返回被删除的项

const colors = ["red", "green"];
+const item = colors.shift(); // 取得第一项
+console.log(item); // red
+console.log(colors.length); // 1
+
1
2
3
4

splice()

splice()传入两个参数,分别是开始位置,删除元素的数量,返回包含删除元素的数组

const colors = ["red", "green", "blue"];
+const removed = colors.splice(0, 1); // 删除第一项
+console.log(colors); // green,blue
+console.log(removed); // red,只有一个元素的数组
+
1
2
3
4

slice()

slice()用于创建一个包含原有数组中一个或多个元素的新数组,不会影响原始数组

const colors = ["red", "green", "blue", "yellow", "purple"];
+const colors2 = colors.slice(1);
+const colors3 = colors.slice(1, 4);
+console.log(colors); // red,green,blue,yellow,purple
+concole.log(colors2); // green,blue,yellow,purple
+concole.log(colors3); // green,blue,yellow
+
1
2
3
4
5
6

即修改原来数组的内容,常用splice

splice()传入三个参数,分别是开始位置,要删除元素的数量,要插入的任意多个元素,返回删除元素的数组,对原数组产生影响

const colors = ["red", "green", "blue"];
+const removed = colors.splice(1, 1, "red", "purple"); // 插入两个值,删除一个元素
+console.log(colors); // red,red,purple,blue
+console.log(removed); // green,只有一个元素的数组
+
1
2
3
4

即查找元素,返回元素坐标或者元素值

  • indexOf()
  • includes()
  • find()

indexOf()

返回要查找的元素在数组中的位置,如果没找到则返回-1

const numbers = [1, 2, 3, 4, 5, 4, 3, 2, 1];
+numbers.indexOf(4); // 3
+
1
2

includes()

返回要查找的元素在数组中的位置,找到返回true,否则false

const numbers = [1, 2, 3, 4, 5, 4, 3, 2, 1];
+numbers.includes(4); // true
+
1
2

find()

返回第一个匹配的元素

const people = [
+  {
+    name: "Matt",
+    age: 27,
+  },
+  {
+    name: "Nicholas",
+    age: 29,
+  },
+];
+people.find((element, index, array) => element.age < 28); // // {name: "Matt", age: 27}
+
1
2
3
4
5
6
7
8
9
10
11

# 二、排序方法


数组有两个方法可以用来对元素重新排序:

  • reverse()
  • sort()

reverse()

顾名思义,将数组元素反向排列

const values = [1, 2, 3, 4, 5];
+values.reverse();
+alert(values); // 5,4,3,2,1
+
1
2
3

sort()

sort()方法接受一个比较函数,用于判断哪个值应该排在前面

function compare(value1, value2) {
+  if (value1 < value2) {
+    return -1;
+  } else if (value1 > value2) {
+    return 1;
+  } else {
+    return 0;
+  }
+}
+const values = [0, 1, 5, 10, 15];
+values.sort(compare);
+alert(values); // 0,1,5,10,15
+
1
2
3
4
5
6
7
8
9
10
11
12

# 三、转换方法


常见的转换方法有:

join()

join() 方法接收一个参数,即字符串分隔符,返回包含所有项的字符串

const colors = ["red", "green", "blue"];
+alert(colors.join(",")); // red,green,blue
+alert(colors.join("||")); // red||green||blue
+
1
2
3

# 四、迭代方法


常用来迭代数组的方法(都不改变原数组)有如下:

  • some()
  • every()
  • forEach()
  • filter()
  • map()

some()

对数组每一项都运行传入的函数,如果有一项函数返回 true ,则这个方法返回 true

const numbers = [1, 2, 3, 4, 5, 4, 3, 2, 1];
+const someResult = numbers.some((item, index, array) => item > 2);
+console.log(someResult); // true
+
1
2
3

every()

对数组每一项都运行传入的函数,如果对每一项函数都返回 true ,则这个方法返回 true

const numbers = [1, 2, 3, 4, 5, 4, 3, 2, 1];
+const everyResult = numbers.every((item, index, array) => item > 2);
+console.log(everyResult); // false
+
1
2
3

forEach()

对数组每一项都运行传入的函数,没有返回值

const numbers = [1, 2, 3, 4, 5, 4, 3, 2, 1];
+numbers.forEach((item, index, array) => {
+  // 执行某些操作
+});
+
1
2
3
4

filter()

对数组每一项都运行传入的函数,函数返回 true 的项会组成数组之后返回

const numbers = [1, 2, 3, 4, 5, 4, 3, 2, 1];
+const filterResult = numbers.filter((item, index, array) => item > 2);
+console.log(filterResult); // 3,4,5,4,3
+
1
2
3

map()

对数组每一项都运行传入的函数,返回由每次函数调用的结果构成的数组

const numbers = [1, 2, 3, 4, 5, 4, 3, 2, 1];
+const mapResult = numbers.map((item, index, array) => item * 2);
+console.log(mapResult); // 2,4,6,8,10,8,6,4,2
+
1
2
3
Last Updated: 3/29/2022, 6:54:57 PM
+ + + diff --git "a/Javascript/eventloop\343\200\201\345\256\217\344\273\273\345\212\241\345\222\214\345\276\256\344\273\273\345\212\241.html" "b/Javascript/eventloop\343\200\201\345\256\217\344\273\273\345\212\241\345\222\214\345\276\256\344\273\273\345\212\241.html" new file mode 100644 index 0000000..5218469 --- /dev/null +++ "b/Javascript/eventloop\343\200\201\345\256\217\344\273\273\345\212\241\345\222\214\345\276\256\344\273\273\345\212\241.html" @@ -0,0 +1,216 @@ + + + + + + event loop、宏任务和微任务 | Zzongke + + + + + + + + + +

event loop、宏任务和微任务

5/24/2022 JavaScript

# 一、event loop、宏任务和微任务

首先推荐一个可以在线看代码流程的网站:loupe (opens new window)。 然后看下这个视频学习下:到底什么是 Event Loop 呢? (opens new window)

简单的例子:

console.log("Hi");
+
+setTimeout(() => {
+  console.log("cb");
+}, 5000);
+
+console.log("Bye");
+
1
2
3
4
5
6
7

它的执行过程是这样的:

event loop、宏任务和微任务

Web APIs 会创建对应的线程,比如 setTimeout 会创建定时器线程,ajax 请求会创建 http 线程。。。这是由 js 的运行环境决定的,比如浏览器。

看完上面的视频之后,至少大家画 Event Loop 的图讲解不是啥问题了,但是涉及到宏任务和微任务,我们还得拜读一下这篇文章:这一次,彻底弄懂 JavaScript 执行机制 (opens new window)。如果意犹未尽,不如再读下这篇非常详细带有大量动图的文章:做一些动图,学习一下 EventLoop (opens new window)。想了解事件循环和页面渲染之间关系的又可以再阅读这篇文章:深入解析你不知道的 EventLoop 和浏览器渲染、帧动画、空闲回调(动图演示) (opens new window)

注意:1.Call Stack 调用栈空闲 -> 2.尝试 DOM 渲染 -> 触发 Event loop。

  • 每次 Call Stack 清空(即每次轮询结束),即同步任务执行完。

  • 都是 DOM 重新渲染的机会,DOM 结构有改变则重新渲染。

  • 然后再去触发下一次 Event loop。

宏任务:setTimeout,setInterval,Ajax,DOM 事件。 微任务:Promise async/await。

两者区别:

  • 宏任务:DOM 渲染后触发,如 setTimeout 、setInterval 、DOM 事件 、script 。

  • 微任务:DOM 渲染前触发,如 Promise.then 、MutationObserver 、Node 环境下的 process.nextTick 。

从 event loop 解释,为何微任务执行更早?

  • 微任务是 ES6 语法规定的(被压入 micro task queue)。

  • 宏任务是由浏览器规定的(通过 Web APIs 压入 Callback queue)。

  • 宏任务执行时间一般比较长。

  • 每一次宏任务开始之前一定是伴随着一次 event loop 结束的,而微任务是在一次 event loop 结束前执行的。

# 二、Promise

关于这一块儿没什么好说的,最好是实现一遍 Promise A+ 规范,多少有点印象,当然面试官也不会叫你默写一个完整的出来,但是你起码要知道实现原理。

关于 Promise 的所有使用方式,可参照这篇文章:ECMAScript 6 入门 - Promise 对象。 +手写 Promise 源码的解析文章,可阅读此篇文章:从一道让我失眠的 Promise 面试题开始,深入分析 Promise 实现细节。 +关于 Promise 的面试题,可参考这篇文章:要就来 45 道 Promise 面试题一次爽到底

手写 Promise

class MyPromise {
+  static pending = "pending";
+  static fulfilled = "fulfilled";
+  static rejected = "rejected";
+  constructor(executor) {
+    if (!this._isFunction(executor)) {
+      throw new Error(`${executor} is not a function`);
+    }
+    this._status = MyPromise.pending;
+    this._state = undefined;
+    this._handleFulfilled = [];
+    this._handleRejected = [];
+    executor(this.resolve.bind(this), this.reject.bind(this));
+  }
+  _isFunction(val) {
+    return Object.prototype.toString.call(val) === "[object Function]";
+  }
+  resolve(val) {
+    if (this._status === MyPromise.pending) {
+      this._status = MyPromise.fulfilled;
+      this._state = val;
+      let cb;
+      // 异步按顺序调用并清空回调
+      setTimeout(() => {
+        while ((cb = this._handleFulfilled.shift())) {
+          cb(val);
+        }
+      }, 0);
+    }
+  }
+  reject(val) {
+    if (this._status === MyPromise.pending) {
+      this._status = MyPromise.rejected;
+      this._state = val;
+      let cb;
+      // 异步按顺序调用并清空回调
+      setTimeout(() => {
+        while ((cb = this._handleRejected.shift())) {
+          cb(val);
+        }
+      }, 0);
+    }
+  }
+  then(onFulfilled, onRejected) {
+    let self = this;
+    const { _state, _status } = this;
+    // 如果onFulfilled、onRejected不是函数,强制改为函数,并且该函数直接返回接收到的参数,传后面的then的回调函数
+    onFulfilled = self._isFunction(onFulfilled) ? onFulfilled : (v) => v;
+    onRejected = self._isFunction(onRejected) ? onRejected : (v) => v;
+    return new MyPromise((resolve, reject) => {
+      const fulfilled = (val) => {
+        let res = onFulfilled(val);
+        if (res instanceof MyPromise) {
+          res.then(resolve, reject);
+        } else {
+          resolve(res);
+        }
+      };
+      const rejected = (value) => {
+        const res = onRejected(value);
+        if (res instanceof MyPromise) {
+          // 这里是重点
+          res.then(resolve, reject);
+        } else {
+          // 注意这里是resolve(res),而不是reject(res)
+          resolve(res);
+        }
+      };
+      switch (_status) {
+        case MyPromise.pending:
+          self._handleFulfilled.push(fulfilled);
+          self._handleRejected.push(rejected);
+          break;
+        case MyPromise.fulfilled:
+          resolve(_state);
+          break;
+        case MyPromise.rejected:
+          rejected(_value);
+          break;
+        default:
+          throw new Error("Promise resolver Unverified status");
+      }
+    });
+  }
+}
+
+new MyPromise((resolve) => {
+  console.log(1);
+  setTimeout(() => {
+    resolve(2);
+  }, 3000);
+}).then((res) => {
+  console.log(res);
+});
+
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

实现一个 Promise.all:

Promise.all = function (promises) {
+  return new Promise((resolve, reject) => {
+    // 参数可以不是数组,但必须具有 Iterator 接口
+    if (typeof promises[Symbol.iterator] !== "function") {
+      reject("Type error");
+    }
+    if (promises.length === 0) {
+      resolve([]);
+    } else {
+      const res = [];
+      let count = 0;
+      const len = promises.length;
+      for (let i = 0; i < len; i++) {
+        //考虑到 promises[i] 可能是 thenable 对象也可能是普通值
+        Promise.resolve(promises[i])
+          .then((data) => {
+            res[i] = data;
+            if (++count === len) {
+              resolve(res);
+            }
+          })
+          .catch((err) => {
+            reject(err);
+          });
+      }
+    }
+  });
+};
+
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

# 三、async/await 和 Promise 的关系

  • async/await 是消灭异步回调的终极武器。

  • 但和 Promise 并不互斥,反而,两者相辅相成。

  • 执行 async 函数,返回的一定是 Promise 对象。

  • await 相当于 Promise 的 then。

  • try...catch 可捕获异常,代替了 Promise 的 catch。

Last Updated: 6/17/2022, 11:36:25 PM
+ + + diff --git "a/Javascript/this\346\214\207\345\220\221.html" "b/Javascript/this\346\214\207\345\220\221.html" new file mode 100644 index 0000000..12f2bb4 --- /dev/null +++ "b/Javascript/this\346\214\207\345\220\221.html" @@ -0,0 +1,320 @@ + + + + + + this指向 | Zzongke + + + + + + + + + +

this指向

4/7/2022 JavaScript

# 一、定义


函数的this关键字在JavaScript中的表现略有不同,此外,在严格模式和非严格模式之间也会有一些差别

在绝大多数情况下,函数的调用方式决定了this的值(运行是绑定)

this关键字是函数运行时自动生成的一个内部对象,只能在函数内部使用,总指向调用它的对象

举个例子:

function baz() {
+  // 当前调用栈是:baz
+  // 因此,当前调用位置是全局作用域
+
+  console.log("baz");
+  bar(); // <-- bar的调用位置
+}
+
+function bar() {
+  // 当前调用栈是:baz --> bar
+  // 因此,当前调用位置在baz中
+
+  console.log("bar");
+  foo(); // <-- foo的调用位置
+}
+
+function foo() {
+  // 当前调用栈是:baz --> bar --> foo
+  // 因此,当前调用位置在bar中
+
+  console.log("foo");
+}
+
+baz(); // <-- baz的调用位置
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

同时,this在函数执行中,this一旦呗确定了,就不可以更改

var a = 10;
+var obj = {
+  a: 20,
+};
+
+function fn() {
+  this = obj; // 修改this,运行后会报错
+  console.log(this.a);
+}
+
+fn();
+
1
2
3
4
5
6
7
8
9
10
11

# 二、绑定规则


根据不同的使用场景,this有不同的值,主要分为下面几种情况:

  • 默认绑定
  • 隐式绑定
  • new 绑定
  • 显示绑定

# 默认绑定

全局环境中定义person函数,内部使用this关键字

var name = "Jenny";
+function person() {
+  return this.name;
+}
+console.log(person()); //Jenny
+
1
2
3
4
5

上述代码输出Jenny,原因是调用函数的对象在浏览器中为window,因此this指向window,所以输出Jenny

注意:

严格模式下,不能将全局对象用于默认绑定,this 会绑定到undefined,只有函数运行在非严格模式下,默认绑定才能绑定到全局对象

# 隐式绑定

函数还可以作为某个对象的方法调用,这时this就指这个上级对象

function test() {
+  console.log(this.x);
+}
+
+var obj = {};
+obj.x = 1;
+obj.m = test;
+
+obj.m(); // 1
+
1
2
3
4
5
6
7
8
9

这个函数中包含多个对象,尽管这个函数是被最外层的对象调用,this指向的也只是它上一级的对象

var o = {
+  a: 10,
+  b: {
+    fn: function() {
+      console.log(this.a); //undefined
+    },
+  },
+};
+o.b.fn();
+
1
2
3
4
5
6
7
8
9

上述代码中,this的上一级对象为b,b内部并没有a变量的定义,所以输出undefined

这里再举一个特殊情况

var o = {
+  a: 10,
+  b: {
+    a: 12,
+    fn: function() {
+      console.log(this.a); //undefined
+      console.log(this); //window
+    },
+  },
+};
+var j = o.b.fn;
+j();
+
1
2
3
4
5
6
7
8
9
10
11
12

此时this指向的是window,这里的大家需要记住,this永远指向的是最后调用它的对象,虽然fn是对象b的方法,但是fn赋值给j时候并没有执行,所以最终指向window

# new 绑定

通过构建函数new关键字生成一个实例对象,此时this指向这个实例对象

function test() {
+  this.x = 1;
+}
+var obj = new text();
+obj.x; //1
+
1
2
3
4
5

上述代码之所以能过输出 1,是因为new关键字改变了this的指向

这里在列举一些特殊情况:

new过程遇到return一个对象,此时this指向为返回的对象

function test() {
+  this.user = "xxx";
+  return {};
+}
+var obj = new test();
+console.log(obj.user); //undefined
+
1
2
3
4
5
6

如果返回一个简单类型的时候,则this指向实例对象

function fn() {
+  this.user = "xxx";
+  return 1;
+}
+var a = new fn();
+console.log(a.user); //xxx
+
1
2
3
4
5
6

注意的是null虽然也是对象,但是此时new仍然指向实例对象

function fn() {
+  this.user = "xxx";
+  return null;
+}
+var a = new fn();
+console.log(a.user); //xxx
+
1
2
3
4
5
6

# 显示修改

apply()、call()、bind()是函数的一个方法,作用是改变函数的调用对象。它的一个参数就表示改变后的调用这个函数的对象。因此,这时this指的就是这第一个参数

var x = 0;
+function test() {
+  console.log(this.x);
+}
+var obj = {};
+obj.x = 1;
+(obj.m = test), obj.m.apply(obj); //1
+
1
2
3
4
5
6
7

# 三、箭头函数


在 ES6 的语法中还提供了箭头函语法,让我们在代码书写时就能确定 this 的指向(编译时绑定)

举个例子:

const obj = {
+  sayThis: () => {
+    console.log(this);
+  },
+};
+
+obj.sayThis(); // window 因为 JavaScript 没有块作用域,所以在定义 sayThis 的时候,里面的 this 就绑到 window 上去了
+const globalSay = obj.sayThis;
+globalSay(); // window 浏览器中的 global 对象
+
1
2
3
4
5
6
7
8
9

虽然箭头函数的 this 能够在编译的时候就确定了this的指向,但也需要注意一些潜在的坑

下面举个例子:

绑定事件监听

const button = document.getElementById("mngb");
+button.addEventListener("click", () => {
+  console.log(this === window); // true
+  this.innerHTML = "clicked button";
+});
+
1
2
3
4
5

上述可以看到,我们其实是想要this为点击的 button,但此时this指向了window

包括在原型上添加方法时候,此时this指向window

Cat.prototype.sayName = () => {
+  console.log(this === window); //true
+  return this.name;
+};
+const cat = new Cat("mm");
+cat.sayName();
+
1
2
3
4
5
6

同样的,箭头函数不能作为构建函数

# 四、优先级


# 隐式绑定 VS 显式绑定

function foo() {
+  console.log(this.a);
+}
+
+var obj1 = {
+  a: 2,
+  foo: foo,
+};
+
+var obj2 = {
+  a: 3,
+  foo: foo,
+};
+
+obj1.foo(); // 2
+obj2.foo(); // 3
+
+obj1.foo.call(obj2); // 3
+obj2.foo.call(obj1); // 2
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

显然,显示绑定的优先级更高

# new 绑定 VS 隐式绑定

function foo(something) {
+  this.a = something;
+}
+
+var obj1 = {
+  foo: foo,
+};
+
+var obj2 = {};
+
+obj1.foo(2);
+console.log(obj1.a); // 2
+
+obj1.foo.call(obj2, 3);
+console.log(obj2.a); // 3
+
+var bar = new obj1.foo(4);
+console.log(obj1.a); // 2
+console.log(bar.a); // 4
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

可以看到,new 绑定的优先级>隐式绑定

new 绑定 VS 显式绑定

因为newapply、call无法一起使用,但硬绑定也是显式绑定的一种,可以替换测试

function foo(something) {
+  this.a = something;
+}
+
+var obj1 = {};
+
+var bar = foo.bind(obj1);
+bar(2);
+console.log(obj1.a); // 2
+
+var baz = new bar(3);
+console.log(obj1.a); // 2
+console.log(baz.a); // 3
+
1
2
3
4
5
6
7
8
9
10
11
12
13

bar被绑定到obj1上,但是new bar(3)并没有像我们预计的那样把obj1.a修改为 3。但是,new修改了绑定调用bar()中的this

我们可认为new绑定优先级>显式绑定

综上,new 绑定优先级 > 显示绑定优先级 > 隐式绑定优先级 > 默认绑定优先级

# 五、apply、call、bind 实现

  • apply
Function.prototype.myApply = function(context) {
+  if (typeof this !== "function") {
+    throw new Error("Type error");
+  }
+  let result = null;
+  context = context || window;
+  // 与上面代码相比,我们使用 Symbol 来保证属性唯一
+  // 也就是保证不会重写用户自己原来定义在 context 中的同名属性
+  const fnSymbol = Symbol();
+  context[fnSymbol] = this;
+  // 执行要被调用的方法
+  if (arguments[1]) {
+    result = context[fnSymbol](...arguments[1]);
+  } else {
+    result = context[fnSymbol]();
+  }
+  delete context[fnSymbol];
+  return result;
+};
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  • call
Function.prototype.myCall = function(context) {
+  // 判断调用对象
+  if (typeof this !== "function") {
+    throw new Error("Type error");
+  }
+  // 首先获取参数
+  let args = [...arguments].slice(1);
+  let result = null;
+  // 判断 context 是否传入,如果没有传就设置为 window
+  context = context || window;
+  // 将被调用的方法设置为 context 的属性
+  // this 即为我们要调用的方法
+  context.fn = this;
+  // 执行要被调用的方法
+  result = context.fn(...args);
+  // 删除手动增加的属性方法
+  delete context.fn;
+  // 将执行结果返回
+  return result;
+};
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  • bind
Function.prototype.myBind = function (context) {
+  // 判断调用对象是否为函数
+  if (typeof this !== "function") {
+    throw new Error("Type error");
+  }
+  // 获取参数
+  const args = [...arguments].slice(1),
+  const fn = this;
+  return function Fn() {
+    return fn.apply(
+      this instanceof Fn ? this : context,
+      // 当前的这个 arguments 是指 Fn 的参数
+      args.concat(...arguments)
+    );
+  };
+};
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

# 6、new 实现

  1. 首先创一个新的空对象。

  2. 根据原型链,设置空对象的 __proto__ 为构造函数的 prototype

  3. 构造函数的 this 指向这个对象,执行构造函数的代码(为这个新对象添加属性)。

  4. 判断函数的返回值类型,如果是引用类型,就返回这个引用类型的对象。

function myNew(Fn, ...args) {
+  //1.创建一个空对象,并将对象的__proto__指向构造函数的prototype 这里我两步一起做了
+  const obj = Object.create(Fn.prototype);
+  //2.将构造函数中的this指向obj,执行构造函数代码,获取返回值
+  const res = Fn.apply(obj, args);
+  console.log(res instanceof Object);
+  //3.判断返回值类型
+  return res instanceof Object ? res : obj;
+}
+
1
2
3
4
5
6
7
8
9
Last Updated: 5/25/2022, 9:07:25 AM
+ + + diff --git "a/Javascript/\344\270\212\346\213\211\345\212\240\350\275\275\344\270\213\346\213\211\345\210\267\346\226\260.html" "b/Javascript/\344\270\212\346\213\211\345\212\240\350\275\275\344\270\213\346\213\211\345\210\267\346\226\260.html" new file mode 100644 index 0000000..e024268 --- /dev/null +++ "b/Javascript/\344\270\212\346\213\211\345\212\240\350\275\275\344\270\213\346\213\211\345\210\267\346\226\260.html" @@ -0,0 +1,210 @@ + + + + + + 上拉加载下拉刷新 | Zzongke + + + + + + + + + +

上拉加载下拉刷新

3/9/2022 JavaScript

上拉加载下拉刷新

# 一、前言


下拉刷新和上拉加载这两种交互方式通常出现在移动端中

本质上等同于 PC 网页中的分页,只是交互形式不同

开源社区也有很多优秀的解决方案,如 iscrollbetter-scrollpulltorefresh.js 库等等

这些第三方库使用起来非常便捷

我们通过原生的方式实现一次上拉加载,下拉刷新,有助于对第三方库有更好的理解与使用

# 二、实现原理


上拉加载及下拉刷新都依赖于用户交互

最重要的是要理解在什么场景,什么时机下触发交互动作

# 上拉加载

首先可以看一张图

上拉加载下拉刷新原理

上拉加载的本质是页面触底,或者快要触底时的动作

判断页面触底我们需要先了解一下下面几个属性

  • scrollTop:滚动视窗的高度距离window顶部的距离,它会随着往上滚动而不断增加,初始值是 0,它是一个变化的值
  • clientHeight:它是一个定值,表示屏幕可视区域的高度;
  • scrollHeight:页面不能滚动时是不存在的,body长度超过window时才会出现,所表示body所有元素的长度

综上我们得出一个触底公式:

scrollTop + clientHeight >= scrollHeight;
+
1

简单实现

let clientHeight = document.documentElement.clientHeight; //浏览器高度
+let scrollHeight = document.body.scrollHeight;
+let scrollTop = document.documentElement.scrollTop;
+
+let distance = 50; //距离视窗还用50的时候,开始触发;
+
+if (scrollTop + clientHeight >= scrollHeight - distance) {
+  console.log("开始加载数据");
+}
+
1
2
3
4
5
6
7
8
9

# 下拉刷新

下拉刷新的本质是页面本身置于顶部时,用户下拉时需要触发的动作

关于下拉刷新的原生实现,主要分成三步:

  • 监听原生 touchstart 事件,记录其初始位置的值,e.touches[0].pageY;
  • 监听原生 touchmove 事件,记录并计算当前滑动的位置值与初始位置值的差值,大于 0 表示向下拉动,并借助 CSS3 的 translateY 属性使元素跟随手势向下滑动对应的差值,同时也应设置一个允许滑动的最大值;
  • 监听原生 touchend 事件,若此时元素滑动达到最大值,则触发 callback,同时将 translateY 重设为 0,元素回到初始位置

举个例子:

Html结构如下:

<main>
+  <p class="refreshText"></p>
+  <ul id="refreshContainer">
+    <li>111</li>
+    <li>222</li>
+    <li>333</li>
+    <li>444</li>
+    <li>555</li>
+    ...
+  </ul>
+</main>
+
1
2
3
4
5
6
7
8
9
10
11

监听touchstart事件,记录初始的值

var _element = document.getElementById("refreshContainer"),
+  _refreshText = document.querySelector(".refreshText"),
+  _startPos = 0, // 初始的值
+  _transitionHeight = 0; // 移动的距离
+
+_element.addEventListener(
+  "touchstart",
+  function(e) {
+    _startPos = e.touches[0].pageY; // 记录初始位置
+    _element.style.position = "relative";
+    _element.style.transition = "transform 0s";
+  },
+  false
+);
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14

监听touchmove移动事件,记录滑动差值

_element.addEventListener(
+  "touchmove",
+  function(e) {
+    // e.touches[0].pageY 当前位置
+    _transitionHeight = e.touches[0].pageY - _startPos; // 记录差值
+
+    if (_transitionHeight > 0 && _transitionHeight < 60) {
+      _refreshText.innerText = "下拉刷新";
+      _element.style.transform = "translateY(" + _transitionHeight + "px)";
+
+      if (_transitionHeight > 55) {
+        _refreshText.innerText = "释放更新";
+      }
+    }
+  },
+  false
+);
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

最后,就是监听touchend离开的事件

_element.addEventListener(
+  "touchend",
+  function(e) {
+    _element.style.transition = "transform 0.5s ease 1s";
+    _element.style.transform = "translateY(0px)";
+    _refreshText.innerText = "更新中...";
+    // todo...
+  },
+  false
+);
+
1
2
3
4
5
6
7
8
9
10

从上面可以看到,在下拉到松手的过程中,经历了三个阶段:

  • 当前手势滑动位置与初始位置差值大于零时,提示正在进行下拉刷新操作
  • 下拉到一定值时,显示松手释放后的操作提示
  • 下拉到达设定最大值松手时,执行回调,提示正在进行更新操作

# 三、案例


在实际开发中,我们更多的是使用第三方库,下面以better-scroll进行举例:

HTML 结构

<div id="position-wrapper">
+  <div>
+    <p class="refresh">下拉刷新</p>
+    <div class="position-list">
+      <!--列表内容-->
+    </div>
+    <p class="more">查看更多</p>
+  </div>
+</div>
+
1
2
3
4
5
6
7
8
9

实例化上拉下拉插件,通过 use 来注册插件

import BScroll from "@better-scroll/core";
+import PullDown from "@better-scroll/pull-down";
+import PullUp from "@better-scroll/pull-up";
+BScroll.use(PullDown);
+BScroll.use(PullUp);
+
1
2
3
4
5

实例化BetterScroll,并传入相关的参数

let pageNo = 1,pageSize = 10,dataList = [],isMore = true;
+var scroll= new BScroll("#position-wrapper",{
+    scrollY:true,//垂直方向滚动
+    click:true,//默认会阻止浏览器的原生click事件,如果需要点击,这里要设为true
+    pullUpLoad:true,//上拉加载更多
+    pullDownRefresh:{
+        threshold:50,//触发pullingDown事件的位置
+        stop:0//下拉回弹后停留的位置
+    }
+});
+//监听下拉刷新
+scroll.on("pullingDown",pullingDownHandler);
+//监测实时滚动
+scroll.on("scroll",scrollHandler);
+//上拉加载更多
+scroll.on("pullingUp",pullingUpHandler);
+
+async function pullingDownHandler(){
+    dataList=[];
+    pageNo=1;
+    isMore=true;
+    $(".more").text("查看更多");
+    await getlist();//请求数据
+    scroll.finishPullDown();//每次下拉结束后,需要执行这个操作
+    scroll.refresh();//当滚动区域的dom结构有变化时,需要执行这个操作
+}
+async function pullingUpHandler(){
+    if(!isMore){
+        $(".more").text("没有更多数据了");
+        scroll.finishPullUp();//每次上拉结束后,需要执行这个操作
+        return;
+    }
+    pageNo++;
+    await this.getlist();//请求数据
+    scroll.finishPullUp();//每次上拉结束后,需要执行这个操作
+    scroll.refresh();//当滚动区域的dom结构有变化时,需要执行这个操作
+}
+function scrollHandler(){
+    if(this.y>50) $('.refresh').text("松手开始加载");
+    else $('.refresh').text("下拉刷新");
+}
+function getlist(){
+    //返回的数据
+    let result=....;
+    dataList=dataList.concat(result);
+    //判断是否已加载完
+    if(result.length<pageSize) isMore=false;
+    //将dataList渲染到html内容中
+}
+
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

注意点:

使用better-scroll 实现下拉刷新、上拉加载时要注意以下几点:

  • wrapper 里必须只有一个子元素
  • 子元素的高度要比 wrapper 要高
  • 使用的时候,要确定 DOM 元素是否已经生成,必须要等到 DOM 渲染完成后,再 new BScroll()
  • 滚动区域的 DOM 元素结构有变化后,需要执行刷新 refresh()
  • 上拉或者下拉,结束后,需要执行 finishPullUp()或者 finishPullDown(),否则将不会执行下次操作
  • better-scroll,默认会阻止浏览器的原生 click 事件,如果滚动内容区要添加点击事件,需要在实例化属性里设置 click:true

# 小结

下拉刷新、上拉加载原理本身都很简单,真正复杂的是封装过程中,要考虑的兼容性、易用性、性能等诸多细节

Last Updated: 3/29/2022, 6:33:46 PM
+ + + diff --git "a/Javascript/\346\225\260\346\215\256\347\261\273\345\236\213\347\232\204\345\210\244\346\226\255.html" "b/Javascript/\346\225\260\346\215\256\347\261\273\345\236\213\347\232\204\345\210\244\346\226\255.html" new file mode 100644 index 0000000..2a444d2 --- /dev/null +++ "b/Javascript/\346\225\260\346\215\256\347\261\273\345\236\213\347\232\204\345\210\244\346\226\255.html" @@ -0,0 +1,123 @@ + + + + + + 数据类型的判断 | Zzongke + + + + + + + + + +

数据类型的判断

5/23/2022 JavaScript

# 一、基本数据类型


JS 中七种内置类型(null,undefined,boolean,number,string,symbol,object)又分为两大类型

# 两大类型:

  • 基本类型:null,undefined,boolean,number,string,symbol
  • 引用类型 Object:Array,Function,Date,RegExp 等

两大基本类型

# 二、数据类型的判断

  • typeof:能判断所有值类型、函数。不可对 null、对象、数组进行精确判断,因为都返回object
console.log(typeof undefined); // undefined
+console.log(typeof 2); // number
+console.log(typeof true); // boolean
+console.log(typeof "str"); // string
+console.log(typeof Symbol("foo")); // symbol
+console.log(typeof 2172141653n); // bigint
+console.log(typeof function() {}); // function
+// 不能判别
+console.log(typeof []); // object
+console.log(typeof {}); // object
+console.log(typeof null); // object
+
1
2
3
4
5
6
7
8
9
10
11
  • instanceof:能判断对象类型,不能判断基本数据类型,其内部运行机制是判断在其原型链中能否找到该类型的原型。比如考虑以下代码:
class People {}
+class Student extends People {}
+
+const vortesnail = new Student();
+
+console.log(vortesnail instanceof People); // true
+console.log(vortesnail instanceof Student); // true
+
1
2
3
4
5
6
7

其实现就是顺着原型链去找,如果能找到对应的 Xxxxx.prototype  即为 true 。比如这里的 vortesnail  作为实例,顺着原型链能找到 Student.prototype  及 People.prototype ,所以都为 true 。

  • Object.prototype.toString.call():所有原始数据类型都是能判断的,还有 Error 对象,Date 对象等。
Object.prototype.toString.call(2); // "[object Number]"
+Object.prototype.toString.call(""); // "[object String]"
+Object.prototype.toString.call(true); // "[object Boolean]"
+Object.prototype.toString.call(undefined); // "[object Undefined]"
+Object.prototype.toString.call(null); // "[object Null]"
+Object.prototype.toString.call(Math); // "[object Math]"
+Object.prototype.toString.call({}); // "[object Object]"
+Object.prototype.toString.call([]); // "[object Array]"
+Object.prototype.toString.call(function() {}); // "[object Function]"
+
1
2
3
4
5
6
7
8
9

在面试中有一个经常被问的问题就是:如何判断变量是否为数组?

Array.isArray(arr); // true
+arr.__proto__ === Array.prototype; // true
+arr instanceof Array; // true
+Object.prototype.toString.call(arr); // "[object Array]"
+
+function toRawType(value) {
+  return Object.prototype.toString
+    .call(value)
+    .slice(8, -1)
+    .toLowerCase();
+}
+
1
2
3
4
5
6
7
8
9
10
11
Last Updated: 5/25/2022, 9:07:25 AM
+ + + diff --git "a/Javascript/\346\265\205\346\213\267\350\264\235\345\222\214\346\267\261\346\213\267\350\264\235.html" "b/Javascript/\346\265\205\346\213\267\350\264\235\345\222\214\346\267\261\346\213\267\350\264\235.html" new file mode 100644 index 0000000..78918f8 --- /dev/null +++ "b/Javascript/\346\265\205\346\213\267\350\264\235\345\222\214\346\267\261\346\213\267\350\264\235.html" @@ -0,0 +1,151 @@ + + + + + + 浅拷贝和深拷贝 | Zzongke + + + + + + + + + +

浅拷贝和深拷贝

3/1/2022 JavaScript

# 浅拷贝和深拷贝

浅拷贝的实现:

function shallowCopy(object) {
+  // 只拷贝对象
+  if (!object || typeof object !== "object") return;
+
+  // 根据 object 的类型判断是新建一个数组还是对象
+  let newObject = Array.isArray(object) ? [] : {};
+
+  // 遍历 object,并且判断是 object 的属性才拷贝
+  for (let key in object) {
+    if (object.hasOwnProperty(key)) {
+      newObject[key] = object[key];
+    }
+  }
+
+  return newObject;
+}
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

深拷贝的实现:

function deepCopy(object) {
+  if (!object || typeof object !== "object") return;
+
+  let newObject = Array.isArray(object) ? [] : {};
+
+  for (let key in object) {
+    if (object.hasOwnProperty(key)) {
+      newObject[key] =
+        typeof object[key] === "object" ? deepCopy(object[key]) : object[key];
+    }
+  }
+
+  return newObject;
+}
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
+ * 深拷贝
+ * @param {Object} obj 要拷贝的对象
+ * @param {Map} map 用于存储循环引用对象的地址
+ */
+
+function deepClone(obj = {}, map = new Map()) {
+  if (typeof obj !== "object") {
+    return obj;
+  }
+  if (map.get(obj)) {
+    return map.get(obj);
+  }
+
+  let result = {};
+  // 初始化返回结果
+  if (
+    obj instanceof Array ||
+    // 加 || 的原因是为了防止 Array 的 prototype 被重写,Array.isArray 也是如此
+    Object.prototype.toString(obj) === "[object Array]"
+  ) {
+    result = [];
+  }
+  // 防止循环引用
+  map.set(obj, result);
+  for (const key in obj) {
+    // 保证 key 不是原型属性
+    if (obj.hasOwnProperty(key)) {
+      // 递归调用
+      result[key] = deepClone(obj[key], map);
+    }
+  }
+
+  // 返回结果
+  return result;
+}
+
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
Last Updated: 5/25/2022, 9:07:25 AM
+ + + diff --git "a/Javascript/\351\230\262\346\212\226\345\222\214\350\212\202\346\265\201.html" "b/Javascript/\351\230\262\346\212\226\345\222\214\350\212\202\346\265\201.html" new file mode 100644 index 0000000..a35c6ed --- /dev/null +++ "b/Javascript/\351\230\262\346\212\226\345\222\214\350\212\202\346\265\201.html" @@ -0,0 +1,232 @@ + + + + + + 函数防抖和节流 | Zzongke + + + + + + + + + +

函数防抖和节流

3/1/2022 JavaScript

# 函数防抖和节流

函数的防抖和节流在我们的工作中经常会用到,在面试中页经常出现,因此今天我们来聊聊防抖和节流

首先我们来看下面这张用竖线画成的图:

"函数防抖和节流!"

这其中的每一条竖线都代表着一次函数调用(如鼠标 mousemove 事件,input 输入事件等)正常执行的时候,调用的频率很快.但有时,我们并不需要这么高的频率去调用这个函数.假如这是一个调用后台接口的操作,那么就容易造成网络堵塞,大大的增加服务器的压力 函数防抖的时候,每次调用事件都是在正常执行暂停后一段时间(等你歇菜了我再上) 函数节流的时候,则是每隔一定的时间间隔就触发一次(管你频率那么快,我就保持自己的节奏) 现在我们大致明白函数的防抖和节流是怎么一回事了,接下来我们就来具体的学习下它们

# 防抖(debounce)

# 概念

在任务频繁触发的情况下,一个事件在被触发的一段时间后再执行回调,假如在这段时间内又被触发了,则重新开始计时。

# 应用场景

防抖在我们的日常生活中,也是随处可见.就比如我们平时坐电梯的时候,总是要等到没有人进来了再一小会儿的工夫,电梯门才会关上.而在项目中,防抖的应用场景也是挺多的.当我们在一个搜索框输入内容进行远程搜索的时候,往往就是在我们停下输入的一小刻时间后.前台向服务器发起了请求来获得匹配的结果.我们甚至于可以将防抖的过程,看成一个英雄在技能读条,只有技能读条结束了,技能才能扔出来.要是中途被人打断了,那么下次又要重新读条了。

# 简易版

<input id="ipt1" type="text" value="" />
+
1

我们先来看下没有防抖的效果:

let ipt1 = document.querySelector("#ipt1");
+ipt1.onkeydown = function(e) {
+  console.log(e.target.value);
+};
+
1
2
3
4

再来看一下加了防抖效果的代码:

let ipt1 = document.querySelector("#ipt1");
+let timer = null;
+ipt1.onkeydown = function(e) {
+  clearTimeout(timer);
+  timer = setTimeout(() => {
+    console.log(e.target.value);
+  }, 500);
+};
+
1
2
3
4
5
6
7
8

大家可以将代码 copy 到编辑器中运行一下看看效果,是不是加了防抖效果的用户体验会更好。

# 函数版

<div id="div1"></div>
+
1
#div1 {
+  height: 300px;
+  background-color: orange;
+  overflow: auto;
+}
+
1
2
3
4
5
let div1 = document.querySelector("#div1");
+function move(e) {
+  this.innerText = `${e.offsetX},${e.offsetY}`;
+}
+function debounce(fn, wait) {
+  let timer = null;
+  return function() {
+    //let that = this;
+    let args = arguments;
+    clearTimeout(timer);
+    timer = setTimeout(() => {
+      fn.apply(this, args);
+    }, wait);
+  };
+}
+let debounceMove = debounce(move, 500);
+div1.onmousemove = debounceMove;
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

其中debounce就是我们的核心防抖函数了

# 节流(throttle)

# 概念

高频事件触发,但是在 n 秒内只会执行一次,会稀释函数的执行频率。

# 应用场景

节流在生活中的实例,就比如看电影的时候,每秒有 24 帧.大概意思就是每一秒钟的电影,其实是给大家播放了 24 张连续的图片.帧数越高,电影看着就越流畅.但是当帧数达到一定的高度时,我们的肉眼已经是看不出区别了.而在项目当中的应用也较多,比如在滚动加载更多的时候,在监听滚动条位置的时候并不是用户每次滚动都要去监听滚动条的位置,而是例如在 1s 内不管滚动多少次,只监听一次滚动条的位置.假如将节流运用到游戏当中,那就相当于技能的 CD,CD 没到,你就是按坏了键盘,技能也放不出来。

# 简易版

<div id="div1">
+  <p>1</p>
+  <p>1</p>
+  ...
+</div>
+
1
2
3
4
5
#div1 {
+  height: 200px;
+  background-color: orange;
+  overflow: auto;
+}
+
1
2
3
4
5

我们先来看下普通的效果,可以看到控制台在疯狂输出:

let div1 = document.querySelector("#div1");
+div1.onscroll = function(e) {
+  console.log("我在疯狂输出");
+};
+
1
2
3
4

再来看下加了节流效果的,控制台每隔一段时间才会打印一次内容:

let div1 = document.querySelector("#div1");
+let flag = true;
+div1.onscroll = function(e) {
+  if (!flag) {
+    return false;
+  }
+  flag = false;
+  setTimeout(() => {
+    console.log("我在慢慢输出");
+    flag = true;
+  }, 500);
+};
+
1
2
3
4
5
6
7
8
9
10
11
12

# 定时器版本

使用定时器来达到节流的效果:

let div1 = document.querySelector("#div1");
+function move(e) {
+  this.innerText = `(${e.offsetX}, ${e.offsetY})`;
+}
+function throttle(fn, delay) {
+  let timer = null;
+  return function(...args) {
+    //let that = this;
+    if (!timer) {
+      timer = setTimeout(() => {
+        timer = null;
+        fn.apply(this, args);
+      }, delay);
+    }
+  };
+}
+let throttleMove = throttle(move, 500);
+div1.onmousemove = throttleMove;
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# 时间戳版本

使用时间戳来达到节流的效果:

function throttle(fn, delay) {
+  let timer = 0;
+  return function(...args) {
+    let that = this;
+    let now = Date.now();
+    if (now - time > delay) {
+      fn.apply(that, args);
+      timer = now;
+    }
+  };
+}
+
1
2
3
4
5
6
7
8
9
10
11

这个版本的时间戳节流当我们的鼠标移出监听区域的时候,即停止运行了

# 定时器+时间戳版本

下面我们来个加强版本的,这个版本是结合了定时器和时间戳,在我们鼠标移出监听区域后,还会再执行一次函数

function throttle(fn, delay) {
+  let time = 0,
+    timer = null;
+  return function(...args) {
+    //let that = this;
+    let now = Date.now();
+    if (now - time > delay) {
+      fn.apply(this, args);
+      time = now;
+    } else {
+      timer && clearTimeout(timer);
+      timer = setTimeout(() => {
+        fn.apply(this, args);
+        time = now;
+      }, delay);
+    }
+  };
+}
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# react-hook 防抖和节流

防抖:

function useDebounceHook(value, delay) {
+  const [debounceValue, setDebounceValue] = useState(value);
+  useEffect(() => {
+    let timer = setTimeout(() => setDebounceValue(value), delay);
+    return () => clearTimeout(timer);
+  }, [value, delay]);
+  return debounceValue;
+}
+
+const [value, setValue] = useState("");
+const debounceText = useDebounceHook(value, 2000);
+useEffect(() => {
+  if (debounceText.length === 0) return;
+  console.log("change", debounceText);
+}, [debounceText]);
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

节流:

function useThrottleValue(value, duration) {
+  const [throttleValue, setThrottleValue] = useState(value);
+  let Local = useRef({ flag: true }).current;
+  useEffect(() => {
+    let timer;
+    if (Local.flag) {
+      Local.flag = false;
+      setThrottleValue(value);
+      setTimeout(() => (Local.flag = true), duration);
+    } else {
+      timer = setTimeout(() => setThrottleValue(value), duration);
+    }
+    return () => clearTimeout(timer);
+  }, [value, duration, Local]);
+  return throttleValue;
+}
+
+const [value, setValue] = useState("");
+const debounceText = useThrottleValue(value, 2000);
+useEffect(() => {
+  if (debounceText.length === 0) return;
+  console.log("change", debounceText);
+}, [debounceText]);
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

总结: 防抖和节流都是为了限制函数的执行频率,以优化函数触发频率过高导致的响应速度跟不上,延迟假死或卡顿的现象

  • 函数防抖:原理是维护一个计时器,在规定时间后执行回调.若在此期间再次触发,则重新开始计时
  • 函数节流:原理是判断是否达到规定时间
Last Updated: 3/29/2022, 6:33:46 PM
+ + + diff --git "a/Other/Ajax\345\216\237\347\220\206\345\222\214\345\256\236\347\216\260.html" "b/Other/Ajax\345\216\237\347\220\206\345\222\214\345\256\236\347\216\260.html" new file mode 100644 index 0000000..84da766 --- /dev/null +++ "b/Other/Ajax\345\216\237\347\220\206\345\222\214\345\256\236\347\216\260.html" @@ -0,0 +1,150 @@ + + + + + + Ajax原理和实现 | Zzongke + + + + + + + + + +

Ajax原理和实现

3/8/2022 Other

# 一、Ajax 是什么?


AJAX 全称(Async Javascript and XML)

即异步的 JavaScriptXML,是一种创建交互式网页应用的网页开发技术,可以在不重新加载整个网页的情况下,与服务器交换数据,并且更新部分网页

Ajax的原理简单来说通过XmlHttpRequest对象来向服务器发异步请求,从服务器获得数据,然后用 JavaScript 来操作 DOM 而更新页面

流程图如下:

new XmlHttpRequest

下面举个例子:

领导想找小李汇报一下工作,就委托秘书去叫小李,自己就接着做其他事情,直到秘书告诉他小李已经到了,最后小李跟领导汇报工作

浏览器可以发送HTTP请求后,接着做其他事情,等收到 XHR 返回来的数据再进行操作

# 二、实现过程


实现 Ajax 异步交互需要服务器逻辑进行配合,需要完成以下步骤:

  • 创建 Ajax 的核心对象 XMLHttpRequest 对象
  • 通过 XMLHttpRequest 对象的 open() 方法与服务端建立连接
  • 构建请求所需的数据内容,并通过 XMLHttpRequest 对象的 send() 方法发送给服务器端
  • 通过 XMLHttpRequest 对象提供的 onreadystatechange 事件监听服务器端你的通信状态
  • 接受并处理服务端向客户端响应的数据结果
  • 将处理结果更新到 HTML 页面中

# 创建 XMLHttpRequest 对象

通过XMLHttpRequest() 构造函数用于初始化一个 XMLHttpRequest 实例对象

const xhr = new XMLHttpRequest();
+
1

# 与服务器建立连接

通过 XMLHttpRequest 对象的 open() 方法与服务器建立连接

xhr.open(method, url, [async][, user][, password])
+
1

参数说明:

  • method:表示当前的请求方式,常见的有GETPOST
  • url:服务端地址
  • async:布尔值,表示是否异步执行操作,默认为true
  • user: 可选的用户名用于认证用途;默认为null
  • password: 可选的密码用于认证用途,默认为null

# 给服务端发送数据

通过 XMLHttpRequest 对象的 send() 方法,将客户端页面的数据发送给服务端

xhr.send([body]);
+
1

body: 在 XHR 请求中要发送的数据体,如果不传递数据则为 null

如果使用GET请求发送数据的时候,需要注意如下:

  • 将请求数据添加到open()方法中的url地址中
  • 发送请求数据中的send()方法中参数设置为null

# 绑定onreadystatechange事件

onreadystatechange 事件用于监听服务器端的通信状态,主要监听的属性为XMLHttpRequest.readyState,关于XMLHttpRequest.readyState属性有五个状态,如下图显示

XMLHttpRequest.readyState

只要 readyState 属性值一变化,就会触发一次 readystatechange 事件

XMLHttpRequest.responseText属性用于接收服务器端的响应结果

举个例子:

const request = new XMLHttpRequest();
+request.onreadystatechange = function(e) {
+  if (request.readyState === 4) {
+    // 整个请求过程完毕
+    if (request.status >= 200 && request.status <= 300) {
+      console.log(request.responseText); // 服务端返回的结果
+    } else if (request.status >= 400) {
+      console.log("错误信息:" + request.status);
+    }
+  }
+};
+request.open("POST", "http://xxxx");
+request.send();
+
1
2
3
4
5
6
7
8
9
10
11
12
13

# 三、封装

通过上面对XMLHttpRequest 对象的了解,下面来封装一个简单的Ajax请求

//封装一个ajax请求
+function ajax(options) {
+  //创建XMLHttpRequest对象
+  const xhr = new XMLHttpRequest();
+
+  //初始化参数的内容
+  options = options || {};
+  options.type = (options.type || "GET").toUpperCase();
+  options.dataType = options.dataType || "json";
+  const params = options.data;
+
+  //发送请求
+  if (options.type === "GET") {
+    xhr.open("GET", options.url + "?" + params, true);
+    xhr.send(null);
+  } else if (options.type === "POST") {
+    xhr.open("POST", options.url, true);
+    xhr.send(params);
+  }
+  //接收请求
+  xhr.onreadystatechange = function() {
+    if (xhr.readyState === 4) {
+      let status = xhr.status;
+      if (status >= 200 && status < 300) {
+        options.success && options.success(xhr.responseText, xhr.responseXML);
+      } else {
+        options.error && options.error(status);
+      }
+    }
+  };
+}
+
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

使用方式如下

ajax({
+  type: "post",
+  dataType: "json",
+  data: {},
+  url: "https://xxxx",
+  success: function(text, xml) {
+    //请求成功后的回调函数
+    console.log(text);
+  },
+  error: function(status) {
+    ////请求失败后的回调函数
+    console.log(status);
+  },
+});
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Last Updated: 3/16/2022, 6:38:11 PM
+ + + diff --git "a/Other/CentOS8\351\205\215\347\275\256Nginx.html" "b/Other/CentOS8\351\205\215\347\275\256Nginx.html" new file mode 100644 index 0000000..2f37c22 --- /dev/null +++ "b/Other/CentOS8\351\205\215\347\275\256Nginx.html" @@ -0,0 +1,104 @@ + + + + + + CentOS8配置Nginx | Zzongke + + + + + + + + + +

CentOS8配置Nginx

3/1/2022 Other

# 1.连接到 Linux CentOS8 的服务器


ssh -p 22 root@ip
+//输入完之后会要输入密码,密码是不显示的,输入完回车就行
+
1
2

# 2.安装编译器


yum -y install gcc pcre-devel zlib-devel openssl openssl-devel
+
1

# 3.建立存放的文件夹


mkdir -p /www/nginx
+
1

# 4.移动到文件夹


cd /www/nginx
+
1

# 5.下载 nginx


wget http://nginx.org/download/nginx-1.20.2.tar.gz
+
1

# 6.解压 nginx.tar.gz


tar -zxvf nginx-1.20.2.tar.gz
+
1

# 7.移动到解压的文件夹


cd nginx-1.20.2
+
1

# 8.配置文件


./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_v2_module
+
1

# 9.编译和安装


make
+make install
+
1
2

# 10.查找安装路径和移动到文件夹


whereis nginx
+cd /usr/local/nginx
+
1
2

# 11.启动 nginx


./sbin/nginx
+
1

# 12.重新加载配置


./sbin/nginx -s reload
+
1
Last Updated: 3/5/2022, 4:30:55 PM
+ + + diff --git "a/Other/Git\345\270\270\347\224\250\346\214\207\344\273\244.html" "b/Other/Git\345\270\270\347\224\250\346\214\207\344\273\244.html" new file mode 100644 index 0000000..334991a --- /dev/null +++ "b/Other/Git\345\270\270\347\224\250\346\214\207\344\273\244.html" @@ -0,0 +1,141 @@ + + + + + + Git常用指令 | Zzongke + + + + + + + + + +

Git常用指令

3/1/2022 Other

# 项目初始化


git init
+
1

项目初始化之后会生成一个.git 文件,如果看不见,那就是电脑隐藏了以.开头的文件

# 项目关联


# 克隆项目


git clone <项目地址>
+git clone -branch [tags标签] <项目地址>	或	git clone -b [tags标签] [项目地址]
+
1
2

表示从远程仓库拉取项目到本地

# 本地项目关联远程仓库


如果我们本地是有项目的,我们想要的是将本地项目和远程仓库关联起来,那么有如下两种情况

  • 本地已有文件与 Git 仓库关联起来(空仓库)




 

git init
+git remote add origin <项目地址>
+git add .	//记得点(.)是要空格隔开
+git commit -m "<提交的信息记录>"
+git push --set-upstream origin master 或 git push -u origin master
+
1
2
3
4
5
  • 非空仓库的情况:




 

 

git init
+git remote add origin xxxx
+git add .
+git commit -m 'init'
+git pull origin master --allow-unrelated-histories
+//若有冲突,先解决冲突
+git push --set-upstream origin master
+
1
2
3
4
5
6
7

可以看出来这两种情况只有在第 5 步的时候才是有区别的.

在上面的 commit 到本地仓库后,如果直接推送,它会报错:

refusing to merge unrelated histories
+
1

意思就是拒绝合并没有历史关系的分支,我们用下面的代码解决这个问题

然后添加下面这行代码:

git pull origin master --allow-unrelated-histories
+
1

我们允许拉取没有历史关系的分支,这步也就是我们代码的第 5 步

# 分支操作


# 查看分支


git branch //查看本地分支
+git branch -r //查看远程分支
+git branch -a //查看本地+远程分支
+git branch -v //分支最后一次提交的信息
+
1
2
3
4

# 切换分支


git branch <BranchName> //创建新分支
+git checkout <BranchName> //切换分支
+git checkout -b <BranchName> //创建新分支并切换到分支
+
1
2
3

# 拉去分支


将远程 Git 仓库里的指定分支拉取到本地(本地不存在的分支)

git checkout -b <本地分支名> <origin/远程分支名>
+
1

# 删除分支


git branch -d <BranchName> //删除本地分支
+git push origin :<BranchName> //删除远程分支
+
1
2

# 创建本地新分支并推送到远程


git branch -b <BranchName> //创建本地新分支并切换到新分支
+git push --set-upstream origin <BranchName>
+
1
2

# 暂存


不想提交当前代码到远程仓库

有时候,我们想要切换分支,但是又不想将当前分支代码提交到本地或远程仓库,直接切换过去的话代码会被覆盖,这时候我们可以使用暂存功能

git stash //存
+git stash pop //取出暂存
+
1
2

# 提交操作


# 代码提交


git add .
+git commit -m "<提交的信息记录>"
+git push
+
1
2
3

提交的时候,可以输入 emoji 表情,可爱又有趣,别人一眼看过来就知道你提交的是关于什么

🐛 //修复 BUG 💄 //更新样式 🔒 //解决安全问题 ♻️ //重构 ✨ //添加新功能

# 提交历史


git log
+git log -3 //显示最近3次的更新
+
1
2

# 本地代码回滚


git reset --hard commit-id //回滚到commit-id
+git reset --hard HEAD~3 //将最近三次的提交回滚
+git reset --hard HEAD^ //将本地代码回退到上一个版本
+
1
2
3

# 标签功能


有时候,我们的项目上线了,我们就需要标签功能,记录我们的版本

git tag //显示已有的标签
+git tag <v1.0.1> //创建一个轻量级标签
+git tag -a <v1.0.2> -m ‘<release version>’ //创建一个带有标注的标签
+git tag -d <tag_name> //删除标签
+git push //并不会把tag标签传送到远端服务器上,只有通过显式命令才能分享标签到远端仓库
+git push origin <tag_name> //push单个tag
+git push origin --tags //推送所有本地新增的标签
+
1
2
3
4
5
6
7

# 配置


# config 配置


最后我们来说一下 config 配置

git config --global user.name  //查看全局配置的用户名
+git config --global user.email  //查看全局配置的邮箱
+git config --global user.name 'zhangsha'  //配置全局的用户名
+git config --global user.email 'xx@xx.com'  //配置全局的邮箱
+//下面是针对单独的项目进行配置和查看
+git config user.name 'lisi'  //配置当前项目的用户名
+git config user.name  //查看当前项目的用户名
+git config --list  //查看多个配置
+
1
2
3
4
5
6
7
8

配置分为全局配置和项目配置,没有对项目进行单独配置的时候,会默认使用全局的配置.如果我们在一个项目中进行了单独的配置,那么就会使用项目中配置.这个选项在你切换不同项目(比如公司和个人项目)的时候,可以起到一定的作用.

Last Updated: 3/5/2022, 4:30:55 PM
+ + + diff --git "a/Other/HTTP\345\222\214HTTPS.html" "b/Other/HTTP\345\222\214HTTPS.html" new file mode 100644 index 0000000..bf37a37 --- /dev/null +++ "b/Other/HTTP\345\222\214HTTPS.html" @@ -0,0 +1,90 @@ + + + + + + HTTP和HTTPS的区别 | Zzongke + + + + + + + + + +

HTTP和HTTPS的区别

3/5/2022 Other

什么是 HTTP? HTTP 和 HTTPS 的区别?

# 一、HTTP


HTTP(HyperText Transfer Protocol),即超文本运输协议,是实现网络通信的一种规范。

在计算机和网络世界有存在不同的协议,如广播协议、寻址协议、路由协议等等......

HTTP是一个传输协议,即将数据由 A 传到 B 或 B 传到 A,并且 A 与 B 之间能够存放很多第三方,如
+A<=>X<=>Y<=>Z<=>B

传输的数据并不是计算机地层中的二进制包,二十完整的、有意义的数据,如 HTML 文件、图片文件、查询结果等超文本,能够被上层引用识别

在实际应用中,HTTP常被用于Web浏览器和网站服务器之间传递信息,以明文方式发送内容,不提供任何方式的数据加密

特点如下:

  • 支持客户/服务器模式
  • 简单快速:客户向服务器请求服务时,只需传送请求方式和路径。由于 HTTP 协议简单,是的 HTTP 服务器的规模小,因而通信速度很快。
  • 灵活:HTTP 允许传输任意类型的数据对象,正在传输的类型由 Content-Type 加以标记
  • 无连接:无连接的含义是限制每次连接只处理一个请求。服务器处理完客户的请求,并受到客户的应答后,即断开连接。采用这种方式可以节省传输时间
  • 无状态:HTTP 协议无法根据之前的状态进行本次的请求处理

# 二、HTTPS


在上述介绍HTTP中,了解到HTTP传递信息是以明文的形式发送内容,这并不安全。而HTTPS出现正式为了解决HTTP不安全的特性

为了保证这些隐私数据能加密传输,让HTTP安全运行的SSL/TLS协议上,即 HTTPS=HTTP+SSL/TLS,通过SSL证书来验证服务器的身份,并为浏览器和服务器之间的通信进行加密

SSL协议位于TCP/IP协议与各种应用层协议之间,浏览器和服务器之间在使用SSL建立连接时需要选择一组恰当的加密算法来实现安全通信,为数据通信提供安全支持

https加密、解密

流程图如下所示:

https传输流程图

  • 首先客户端通过 URL 访问服务器建立 SSL 连接
  • 服务器收到客户端请求后,会将网站支持的证书信息(证书中包含公钥)传送一份给客户端
  • 客户端的服务器开始协商 SSL 连接的安全的等级,也就是信息加密的等级
  • 客户端的浏览器根据双方同意的等级,建立会话密钥,然后利用网站的公钥将会话密钥加密,并传送个网站
  • 服务器利用自己的私钥解密出会话密钥
  • 服务器利用会话密钥加密与客户端之间的通信

# 三、区别


  • HTTPS 是 HTTP 协议的安全版本,HTTP 协议的数据传输是明文的,是不安全的,HTTPS 使用了 SSL/TLS 协议进行了加密处理,相对更安全
  • HTTP 和 HTTPS 使用连接方式不同,默认端口也不一样,HTTP 是 80,HTTPS 是 443
  • HTTPS 由于需要设计加密以及多次握手,性能方面不如 HTTP
  • HTTPS 需要 SSL,SSL 证书需要钱,功能越强大的证书费用越高
Last Updated: 3/5/2022, 4:30:55 PM
+ + + diff --git "a/Other/HTTP\345\270\270\350\247\201\347\232\204\347\212\266\346\200\201\347\240\201.html" "b/Other/HTTP\345\270\270\350\247\201\347\232\204\347\212\266\346\200\201\347\240\201.html" new file mode 100644 index 0000000..564c4f0 --- /dev/null +++ "b/Other/HTTP\345\270\270\350\247\201\347\232\204\347\212\266\346\200\201\347\240\201.html" @@ -0,0 +1,89 @@ + + + + + + HTTP 常见的状态码 | Zzongke + + + + + + + + + +

HTTP 常见的状态码

3/5/2022 Other

HTTP 常见的状态码

# 一、是什么


HTTP 状态码(英语:HTTP Status Code),用以表示网页服务超文本传输协议响应状态的 3 为数字代码

它由 RFC2616 规范定义的,并得到RFC 2518RFC 2817RFC 2295RFC 2774RFC 4918等规范扩展

简单来讲,http状态码的作用是服务器告诉客户端当前请求响应的状态,通过状态码就能判断和分析服务器的运行状态

# 二、分类


状态码第一位数字决定了不同的响应状态,有如下:

  • 1 表示消息
  • 2 表示成功
  • 3 表示重定向
  • 4 表示请求错误
  • 5 表示服务器错误

# 1xx

代表请求已被接受,需要继续处理。这类响应是临时响应,只包含状态行和某些可选的响应头信息,并以空行结束

常见的有:

  • 100(客户端继续发送请求,这是临时响应):这个临时响应是用来通知客户端它的部分请求已经被服务器接收,且仍未被拒绝。客户端应当继续发送请求的剩余部分,或者如果请求已经完成,忽略这个响应。服务器必须在请求完成后向客户端发送一个最终响应
  • 101:服务器根据客户端的请求切换协议,主要用于 websocket 或 http2 升级

# 2xx

代表请求已成功被服务器接收、理解、并接受

常见的有:

  • 200(成功):请求已成功,请求所希望的响应头或数据体将随此响应返回
  • 201(已创建):请求成功并且服务器创建了新的资源
  • 202(已创建):服务器已经接收请求,但尚未处理
  • 203(非授权信息):服务器已成功处理请求,但返回的信息可能来自另一来源
  • 204(无内容):服务器成功处理请求,但没有返回任何内容
  • 205(重置内容):服务器成功处理请求,但没有返回任何内容
  • 206(部分内容):服务器成功处理了部分请求

# 3xx

表示要完成请求,需要进一步操作。 通常,这些状态代码用来重定向

常见的有:

  • 300(多种选择):针对请求,服务器可执行多种操作。 服务器可根据请求者 (user agent) 选择一项操作,或提供操作列表供请求者选择
  • 301(永久移动):请求的网页已永久移动到新位置。 服务器返回此响应(对 GET 或 HEAD 请求的响应)时,会自动将请求者转到新位置
  • 302(临时移动): 服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求
  • 303(查看其他位置):请求者应当对不同的位置使用单独的 GET 请求来检索响应时,服务器返回此代码
  • 305 (使用代理): 请求者只能使用代理访问请求的网页。 如果服务器返回此响应,还表示请求者应使用代理
  • 307 (临时重定向): 服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求

# 4xx

代表了客户端看起来可能发生了错误,妨碍了服务器的处理

常见的有:

  • 400(错误请求): 服务器不理解请求的语法
  • 401(未授权): 请求要求身份验证。 对于需要登录的网页,服务器可能返回此响应。
  • 403(禁止): 服务器拒绝请求
  • 404(未找到): 服务器找不到请求的资源
  • 405(方法禁用): 禁用请求中指定的方法
  • 406(不接受): 无法使用请求的内容特性响应请求的网页
  • 407(需要代理授权): 此状态代码与 401(未授权)类似,但指定请求者应当授权使用代理
  • 408(请求超时): 服务器等候请求时发生超时

# 5xx

表示服务器无法完成明显有效的请求。这类状态码代表了服务器在处理请求的过程中有错误或者异常状态发生

常见的有:

  • 500(服务器内部错误):服务器遇到错误,无法完成请求
  • 501(尚未实施):服务器不具备完成请求的功能。 例如,服务器无法识别请求方法时可能会返回此代码
  • 502(错误网关): 服务器作为网关或代理,从上游服务器收到无效响应
  • 503(服务不可用): 服务器目前无法使用(由于超载或停机维护)
  • 504(网关超时): 服务器作为网关或代理,但是没有及时从上游服务器收到请求
  • 505(HTTP 版本不受支持): 服务器不支持请求中所用的 HTTP 协议版本

# 三、适用场景


下面给出一些状态码的适用场景:

  • 100:客户端在发送 POST 数据给服务器前,征询服务器情况,看服务器是否处理 POST 的数据,如果不处理,客户端则不上传 POST 数据,如果处理,则 POST 上传数据。常用于 POST 大数据传输
  • 206:一般用来做断点续传,或者是视频文件等大文件的加载
  • 301:永久重定向会缓存。新域名替换旧域名,旧的域名不再使用时,用户访问旧域名时用 301 就重定向到新的域名
  • 302:临时重定向不会缓存,常用 于未登陆的用户访问用户中心重定向到登录页面
  • 304:协商缓存,告诉客户端有缓存,直接使用缓存中的数据,返回页面的只有头部信息,是没有内容部分
  • 400:参数有误,请求无法被服务器识别
  • 403:告诉客户端进制访问该站点或者资源,如在外网环境下,然后访问只有内网 IP 才能访问的时候则返回
  • 404:服务器找不到资源时,或者服务器拒绝请求又不想说明理由时
  • 503:服务器停机维护时,主动用 503 响应请求或 nginx 设置限速,超过限速,会返回 503
  • 504:网关超时
Last Updated: 6/14/2022, 4:00:06 PM
+ + + diff --git a/Other/Markdown.html b/Other/Markdown.html new file mode 100644 index 0000000..aedb170 --- /dev/null +++ b/Other/Markdown.html @@ -0,0 +1,163 @@ + + + + + + Markdown 语法指南 | Zzongke + + + + + + + + + +

Markdown 语法指南

3/1/2022 Other

Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档

# 标题

使用#号可表示 1-6 级标题,一级标题对应一个#号,二级标题对应两个#号,以此类推。

# 一级标题
+## 二级标题
+### 三级标题
+#### 四级标题
+##### 五级标题
+###### 六级标题
+
1
2
3
4
5
6

效果如下:

# 一级标题

# 二级标题

# 三级标题

# 四级标题

# 五级标题
# 六级标题

也可以使用==来表示 1 级标题,__来表示 2 级标题

这是一级标题
+==
+这是二级标题
+--
+
1
2
3
4

效果如下:

# 一级标题

# 二级标题

# 字体

*我是斜体*
+_我是斜体_
+**我是粗体**
+__我是粗体__
+***我是粗斜体***
+___我是粗斜体___
+
1
2
3
4
5
6

我是斜体

我是斜体

我是粗体

我是粗体

我是粗斜体

我是粗斜体

# 线条

~~我是删除~~
+<u>这是一条下划线</u>
+这是一条分割线
+***
+这是一条分割线
+* * *
+这是一条分割线
+- - -
+这是一条分割线
+--------
+
1
2
3
4
5
6
7
8
9
10

我是删除

这是一条下划线

这是一条分割线


这是一条分割线


这是一条分割线


# 这是一条分割线

注意:三个或三个以上的-*

# 列表

# 无序列表

使用+, -, * 其中任何一个作为标记

* list1
++ list2
+- list3
+
1
2
3
  • list1
  • list2
  • list3

# 有序列表

使用数字 + .来表示

1. list1
+2. list2
+3. list3
+
1
2
3
  1. list1
  2. list2
  3. list3

# 列表嵌套

1. list1
+  - list1-1
+  - list1-2
+2. list2
+  - list2-1
+  - list2-2
+
1
2
3
4
5
6
  1. list1
  • list1-1
  • list1-2
  1. list2
  • list2-1
  • list2-2

# 任务列表

注:此种写法在 vuepress 中无效,可以使用原生的复选框代替

- [ ] 吃饭
+- [x] 睡觉  //打x的表示已完成
+- [ ] 打豆豆
+
1
2
3
  • [ ] 吃饭
  • [x] 睡觉 //打 x 的表示已完成
  • [ ] 打豆豆
<label><input type="checkbox">吃饭</label>
+<label><input type="checkbox" checked>睡觉</label>
+<label><input type="checkbox">打豆豆</label>
+
1
2
3

# 引用

可以无限引用,但是没什么太大的意义

> 前言:第一层引用
+>> 前言:第二层引用
+
1
2

前言:第一层引用

前言:第二层引用

# 链接

[百度](https://www.baidu.com)
+
1

百度 (opens new window)

<https://www.baidu.com>
+
1

https://www.baidu.com (opens new window)

# 图片

![alt 属性文本](图片链接)
+![占位符](https://iph.href.lu/200x200)	//在线图片
+![占位符](/achievements-icon.png "测试")	//本地图片
+
1
2
3

占位符 占位符

# 表格

Markdown 使用 | 来分隔不同单元格,使用 - 来分隔表头和主体

|标题1|标题2|标题2
+| :- | :-: | -:
+|行1列1|行1列2|行1列3
+|行2列1|行2列2|行2列3
+
1
2
3
4
标题 1 标题 2 标题 2
行 1 列 1 行 1 列 2 行 1 列 3
行 2 列 1 行 2 列 2 行 2 列 3

# 代码

# 单行代码

(```)
+console.log(1)
+(```)
+
1
2
3

这里在几个平台测试了一下,发现有的能显示,有的不能显示,所以这里在 ```外面包裹一层()只用于展示使用 效果如下:

console.log(1)
+
1

或者直接使用 4 个空格,也是可以展示一个代码片段

console.log(1)
+
1

# 流程图

Markdown 还支持流程图或甘特图之类的.但是因为不同的平台对其支持都是不同的,有的支持,有的不支持,因此就不展示流程图的代码了。

# 兼容 HTML

Markdown 的目标是成为一种适用于网络的书写语言.它的标签较少,只对应了 HTML 中的一部分.不在其覆盖范围内的,我们可以使用 html 标签来书写.(貌似也有的平台是不支持的)

<span style="color:orange;">orange</span>
+
1

效果如下:

orange

使用kbd来展示按键:

<kbd>Ctrl</kbd>+<kbd>S</kbd>
+
1

Ctrl+S来保存文档

使用反斜杠转义特殊字符:

\*\* 正常显示 \*\*
+
1

** 正常显示 **

# 注解

使用[^]来定义注解:(vuepress中无效)

我是一个注解[^注解1]
+我也是一个注解[^注解2]
+去[百度][1]
+
+[^注解1]:我是注解1
+
+[^注解2]:我是注解2
+[1]: http://www.baidu.com
+
1
2
3
4
5
6
7
8

效果如下:

我是一个注解[^注解1]
+我也是一个注解[^注解2]
+去Google (opens new window)

[^注解1]: 我是注解 1 +[^注解2]: 我是注解 2

Last Updated: 3/5/2022, 4:30:55 PM
+ + + diff --git "a/Other/SEO\344\274\230\345\214\226\351\207\215\350\246\201\347\232\204\345\205\203\346\240\207\347\255\276.html" "b/Other/SEO\344\274\230\345\214\226\351\207\215\350\246\201\347\232\204\345\205\203\346\240\207\347\255\276.html" new file mode 100644 index 0000000..0f70011 --- /dev/null +++ "b/Other/SEO\344\274\230\345\214\226\351\207\215\350\246\201\347\232\204\345\205\203\346\240\207\347\255\276.html" @@ -0,0 +1,119 @@ + + + + + + SEO优化重要的元标签 | Zzongke + + + + + + + + + +

SEO优化重要的元标签

6/26/2022 Other

# 1.Title标签


<title>页面标签</title>
+
1

<title/>标签可以说是最主要、最重要的SEOn优化的元素。它将直接显示在搜索引擎的接口页里面,社交媒体分享,浏览器的标签页都将直接使用这个标题。

标题对于让用户快速了解搜索结果的内容至关重要。这是用户对你网页的第一印象,它通常是决定点击哪个结果的重要影响因素,因此在你的网页上使用高质量的标题很重要。

最佳实践:

  • 为每个页面写一个唯一的标题标签
  • 简短但具有描述性
  • 避免通用和模糊的标题
  • 创造一些值得点击的东西,抓住用户的好奇心
  • 去猜测搜索意图,尽量匹配上
  • 包含长尾关键字
  • 保持在60个字符以内,超过这个长度搜索引擎会将标题截断

# 2.Meta Description标签


该meta标签用于描述总结页面的内容。搜索引擎经常将其用于搜索结果的片段中,放在标题下面。它占据了搜索结果片段的很大部分的内容,内容的好坏很大程度上会影响用户是否点击这个结果,你需要设置一个引人注目的描述。谷歌不使用描述作为排名英语。

最佳实践:

  • 给每个页面一个独特的描述,并清楚的反映内容
  • 描述必须即真实又吸引人
  • Google的摘要通常最多可包含150-160个字符(包括空格)
  • 包括你最重要的关键字,以便它们可以在搜索结果页上突出显示,但要小心避免关键字堆砌

# 3.标题标签(h1-h6)


<h1>h1</h1>
+<h1>h2</h1>
+<h1>h3</h1>
+<h1>h4</h1>
+<h1>h5</h1>
+<h1>h6</h1>
+
1
2
3
4
5
6

标题标签是HTML标签,HTML<h1>-<h6>标题(Heading)元素呈现了六个不同的级别的标题,<h1> 级别最高,而<h6>级别最低。它可以用来识别内容的结果层级。

现在标题标签不再是搜索引擎排名因素,标题标签中添加关键字,不一定可以使你的排名更好,但是对爬虫来说理解组织良好的内容更为容易。同时也方便用户理解页面内容。

最佳实践:

  • 给每个页面一个独特的描述,并清楚地放映内容
  • 描述必须即真实又吸引人
  • Google 的摘要通常最多可包含 150-160 个字符(包括空格)
  • 包括你最重要的关键字,以便它们可以在搜索结果页上上突出显示,但要小心避免关键字堆砌

# 4.图片Alt属性


<img src="https://popeke.com/images/popeke@750w_20h.png" alt="popeke" />
+
1

图片的alt属性被添加到<img/>标签以描述其内容。

Alt属性在页面优化方面很重要,原因有两个:

  • 如果无法加载任何特定图像(或图像被禁用),则会访问者显示替代文本。
  • 搜索引擎无法读取图像,你应该为图像添加适当的替代文字,以便搜索引擎知道如何解释它们

最佳实践:

  • 始终使用正确的描述,切勿在此标签中填充关键字
  • 使用信息丰富的文件名,且清楚明了
  • 创建图像站点地图
  • 在替代文本中使用 50-55 个字符(最多16个单词)

# 5.Robots Meta标签


机器人元标记告诉搜索引擎索引或不索引你的网页。

该标签对搜索引擎爬虫有四个主要值:

  • follow - 搜索引擎爬虫将跟随该网页中的所有链接
  • index – 搜索引擎爬虫会索引整个网页
  • nofollow – 搜索引擎爬虫不会跟踪页面和该网页中的任何链接
  • noindex – 搜索引擎爬虫不会将该网页编入索引 为你的机器人元标记使用以下语法:
<meta name="robots" content="noindex, nofollow"> 表示不索引或不关注本网页。
+
+<meta name="robots" content="index, follow"> 表示索引并关注这个网页。
+
1
2
3

最佳实践:

  • 仅当你想限制搜索引擎抓取页面时才使用 Robots meta 标签
  • 不要在 robots.txt 中屏蔽带 Robots meta 标签的页面

# 6.Canonical标签


<link rel="canonical" href="https://popeke.com/" />
+
1

rel=“canonical” link 标签为类似网页或重复网页指定权威网页。 它告诉搜索引擎哪个版本的页面是主要页面并希望被搜索引擎索引。

# 7.社交媒体 Meta 标签


现如今有两个主要标准定义如何格式化此元数据:Twitter Cards 和 Facebook Open Graph 协议。

# 一、Facebook Open Graph


Open Graph (开放图谱协议)由 Facebook 的创建,简称 OG 协议或 OGP。它是 Facebook 在 2010 年 F8 开发者大会公布的一种网页元信息(Meta Information)标记协议,属于 Meta Tag (Meta 标签)的范畴,是一种为社交分享而生的 Meta 标签。它允许在 Facebook 上,其他网站能像 Facebook 内容一样具有丰富的媒体对象,进而促进 Facebook 和其他网站之间的集成。

Open Graph 标签不仅被 Facebook 使用,也被 LinkedIn 和 Twitter 等平台使用。请注意 Twitter 也有自己的一套 Twitter Cards 定义,如果网页提供了 Twitter 自己的定义,则优先使用自己的标准。

# Open Graph 常用属性

# 标题
+<meta property="og:title" content="HTML meta 标签详解">
+# 类型
+<meta property="og:type" content="article">
+# 网页的永久链接
+<meta property="og:url" content="https://popeke.com/">
+# 网页的需要展示图片
+<meta property="og:image" content="https://popeke.com/images/popeke@750w_20h.png">
+
1
2
3
4
5
6
7
8

对于 Open Graph 来说,每个页面里需要以上四个必需属性:

  • og:title - 网页的标题,例如“刘星的个人网站”
  • og:type - 网页的类型,所描述内容的类型。可以是 article,book,website, profile 等
  • og:image - 一个图像 URL, 用于设置与页面关联的图像
  • og:url - 对象的规范 URL

Open Graph 协议定义了一些网页类型, 包括 article、book、website、profile 等。

如果你的网页为个人主页,og:type 可以为 profile;如果你的网页是一个视频为主的网页面,则可以为video;如果你的网页是一篇博客文章则可以为article。如果你的网页没什么特殊的类别,则可将og:type 设置为通用的website

除了以上四个必需属性之外,Open Graph 还有以下常用属性:

<meta property="og:description" content="Description Here">
+<meta property="og:site_name" content="Site Name">
+<meta property="og:locale" content="zh_CN">
+<meta property="og:video" content="link">
+<meta property="og:audio" content="link">
+
1
2
3
4
5
  • og:site_name 你的网站的名称
  • og:description 你的页面的描述
  • og:audio - 网页中的音频链接
  • og:locale - 标记语言环境。格式为 language_TERRITORY。默认为 en_US。
  • og:video - 你网页中的视频链接

除了以上介绍的常用内容外,Open Graph 还有很多属性。有关 Open Graph 协议的更多信息,请访问官方 Open Graph 协议网站 https://ogp.me/ (opens new window)

如果你的网站设置了 Open Graph 你可以使用 facebook 的 debug 工具 (opens new window) 来调试及查看显示效果

# 二、Twitter Card


大多数社交网站都遵循 Open Graph 协议,但是也有一些平台自己实现了一些定义,例如 Twitter。

Twitter Cards 是 Twitter 使用的元数据规范,用于在 Twitter 上共享链接时显示富文本、图像和视频。

# Twitter Cards 常用属性

Twitter Cards 有四种不同的类型:Summary, Summary Card With Large Image, App, 和 Player.

<meta name=twitter:card content="summary_large_image">
+<meta name=twitter:image content="https://popeke.com/images/popeke@750w_20h.png">
+<meta name=twitter:title content="HTML meta 标签详解">
+<meta name=twitter:description content="meta 标签标签定义了关于 HTML 文档的元数据">
+<meta name="twitter:creator" content="@yedaniu">
+<meta name="twitter:site" content="@site_account">
+
1
2
3
4
5
6
  • twitter:card : 卡片类型,将是 summary、summary_large_image、app 或 player 之一
  • twitter:site : 用于卡片页脚中使用的网站 @username
  • twitter:creator :内容创建者 / 作者的 @username
  • twitter:url : 分享对象的链接
  • twitter:title : 分享对象的标题 (最多 70 个字符)
  • twitter:description : 分享对象的描述 (最多 200 个字符)
  • twitter:image : 分享对象的图片 URL, 支持的格式有 JPG、PNG、WEBP 和 GIF。只会导入 GIF 的第一帧

上面介绍了 Twitter Cards 一些常用属性,有关其他 Twitter Card 标签和选项的更多信息,请访问『官方 Twitter Cards 文档』( https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards) (opens new window)

如果你的网站设置了 Open Graph 你可以使用 Twitter Cards (opens new window) 验证器 来调试及查看显示效果

# Open Graph 与 Twitter Cards 常用属性汇总

Facebook 和 Twitter 提供了有关如何使用上述元标记的指南。在下表中,我们总结了有关它们的基本信息以及各自的建议。

元标签 facebook twitter
标题 og:title 文章的标题,例如你的网站名称。 twitter:title Twitter 卡片的必需参数,最大长度 70 个字符。
图片 og:image 当有人将内容分享到 Facebook 时显示的图像的 URL twitter:image 表示页面内容的唯一图像的 URL
网站 og:url 你页面的规范 URL twitter:url 你页面的规范 URL
描述 og:description 对内容的简要描述,通常在 2 到 4 个句子之间。这将显示在 Facebook 帖子的标题下方 Twitter:description 简明概括内容的描述,适合在推文中呈现。你不应重复使用标题作为描述或使用此字段来描述网站提供的一般服务

# 8. 响应式设计 viewport Meta 标签


视口标记允许你配置页面在任何设备上的缩放和显示方式。

<meta name="viewport" content="width=device-width, initial-scale=1"/>
+
1

视口元标记与排名没有直接关系,但与用户体验有关。

同时谷歌在移动搜索结果中对移动端友好的网页的排名更高

最佳实践:

  • 在所有网页上设置 viewport 标签
Last Updated: 6/26/2022, 12:24:49 PM
+ + + diff --git "a/Other/SPA\351\246\226\345\261\217\345\212\240\350\275\275\351\200\237\345\272\246.html" "b/Other/SPA\351\246\226\345\261\217\345\212\240\350\275\275\351\200\237\345\272\246.html" new file mode 100644 index 0000000..2cccfaf --- /dev/null +++ "b/Other/SPA\351\246\226\345\261\217\345\212\240\350\275\275\351\200\237\345\272\246.html" @@ -0,0 +1,119 @@ + + + + + + SPA(单页应用)首屏加载速度 | Zzongke + + + + + + + + + +

SPA(单页应用)首屏加载速度

3/3/2022 Other

# 一、什么是首屏加载


首屏时间(First Contentful Paint),指的是浏览器从响应用户输入网址地址,到首屏内容渲染完成的时间,此时整个网页不一样要全部渲染完成,但需要展示当前视窗需要的内容

首屏加载可以说是用户体验中重要的环节。

# 二、加载慢的原因


在页面渲染的过程,导致加载速度慢的因素可能如下:

  • 网络延时问题
  • 资源文件体积是否过大
  • 资源是否重发发送请求去加载了
  • 加载脚本的时候,渲染内容堵塞

# 三、解决方案


常见的几种 SPA 首屏优化方式

  • 减少入口文件体积
  • 静态资源本地缓存
  • UI 框架按需加载
  • 图片资源压缩
  • 开启 Gzip 压缩
  • 使用 SSR

# 减少入口文件体积

  1. 常用的手段是路由懒加载,把不同路由对应的组件分割成不同的代码块,待路由被请求的时候会单独打包路由,使得入口文件变小,加载速度大大增加。
  2. 还有就是使用 cdn 加速,减少文件体积,但是要是看别人的 cdn 服务器稳不稳定,也可以自己下载 cdn 放到自己服务器,但是自己服务器没有 cdn 分发的话,速度就会在下载 cdn 文件时候影响加载速度。

# 静态资源本地缓存


后端返回的资源问题:

  • 采用HTTP缓存,设置Cache-ControlLast-ModifiedEtag等响应头
  • 采用Service Worker离线缓存 +前端合理使用 LocalStorage

# UI 框架按需加载

# 图片资源的压缩

图片资源虽然不在编码过程中,但它却是对页面性能影响最大的因素 +对于所有的图片资源,我们可以进行适当的压缩 +对于页面上使用到的 icon,可以使用在线字体图标,或者雪碧图,将众多小图标合并到一张图上,减少HTTP请求次数

# 开启 Gzip 压缩

拆完包之后,我们在使用Gzip做一下压缩,安装compression-webpack-plugin

yarn add compression-webpack-plugin -D
+
1

vue.config.js中引入并修改webpack配置

const CompressionWebpackPlugin = require("compression-webpack-plugin");
+module.exports={
+  ...,//省略
+  configureWebpack:{
+    plugins:[
+      new CompressionWebpackPlugin({
+        test:/\.(js|css)$/,//匹配文件名
+        threshold:10240,//对超过10k的数据进行压缩
+        minRatio: 0.8, // 压缩比
+        deleteOriginalAssets: false //是否删除原文件
+         exclude: "/node_modules/",
+      })
+    ]
+  },
+  ...
+}
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

在服务器我们也要做相应的配置,比如Nginx

gzip on;
+gzip_disable "msie6";
+gzip_vary on;
+gzip_proxied any;
+gzip_comp_level 6;
+gzip_buffers 16 8k;
+gzip_http_version 1.1;
+gzip_min_length 256;
+gzip_types application/atom+xml application/geo+json application/javascript application/x-javascript application/json application/ld+json application/manifest+json application/rdf+xml application/rss+xml application/xhtml+xml application/xml font/eot font/otf font/ttf image/svg+xml text/css text/javascript text/plain text/xml;
+
1
2
3
4
5
6
7
8
9

# 使用 SSR

SSR(Server side),也就是服务器渲染,组件或页面通过服务器生成 html 字符串,再发送到浏览器 +从头搭建一个服务器渲染是很复杂的,Vue应用建议使用Nuxt.js实现服务器渲染

# 小结

减少首屏渲染时间的方法有很多,总的来讲可以分成两大部分,资源加载优化和页面渲染优化

下图是更为全面的首屏优化的方案

首屏优化

大家可以根据自己项目的情况选择各种方式进行首屏渲染的优化

Last Updated: 3/5/2022, 4:30:55 PM
+ + + diff --git "a/Other/TCP\344\270\272\344\273\200\344\271\210\351\234\200\350\246\201\344\270\211\346\254\241\346\217\241\346\211\213\345\222\214\345\233\233\346\254\241\346\214\245\346\211\213.html" "b/Other/TCP\344\270\272\344\273\200\344\271\210\351\234\200\350\246\201\344\270\211\346\254\241\346\217\241\346\211\213\345\222\214\345\233\233\346\254\241\346\214\245\346\211\213.html" new file mode 100644 index 0000000..09a2f32 --- /dev/null +++ "b/Other/TCP\344\270\272\344\273\200\344\271\210\351\234\200\350\246\201\344\270\211\346\254\241\346\217\241\346\211\213\345\222\214\345\233\233\346\254\241\346\214\245\346\211\213.html" @@ -0,0 +1,92 @@ + + + + + + TCP为什么需要三次握手和四次挥手 | Zzongke + + + + + + + + + +

TCP为什么需要三次握手和四次挥手

3/6/2022 Other

TCP三次握手和四次挥手

# 一、三次握手


三次握手(Three-way Handshake)其实就是指建立一个 TCP 连接时,需要客户端和服务器总共发送 3 个包

主要作用就是为了确认双方的接收能力和发送能力是否正常、指定自己的初始化序列号为后面的可靠性传送做准备

过程如下:

  • 第一次握手:客户端给服务端发一个 SYN 报文,并指明客户端的初始化序列号 ISN(c),此时客户端处于 SYN_SENT 状态
  • 第二次握手:服务器收到客户端的 SYN 报文之后,会以自己的 SYN 报文作为应答,为了确认客户端的 SYN,将客户端的 ISN+1 作为 ACK 的值,此时服务器处于 SYN_RCVD 的状态
  • 第三次握手:客户端收到 SYN 报文之后,会发送一个 ACK 报文,值为服务器的 ISN+1。此时客户端处于 ESTABLISHED 状态。服务器收到 ACK 报文之后,也处于 ESTABLISHED 状态,此时,双方已建立起了连接

TCP三次握手

上述每一次握手的作用如下:

  • 第一次握手:客户端发送网络包,服务端收到了
    +这样服务端就能得出结论:客户端的发送能力、服务端的接收能力是正常的。

  • 第二次握手:服务端发包,客户端收到了
    +这样客户端就能得出结论:服务端的接收、发送能力,客户端的接收、发送能力是正常的。不过此时服务器并不能确认客户端的接收能力是否正常

  • 第三次握手:客户端发包,服务端收到了。
    +这样服务端就能得出结论:客户端的接收、发送能力正常,服务器自己的发送、接收能力也正常

通过三次握手,就能确定双方的接收和发送能力是正常的。之后就可以正常通信了

# 为什么不是两次握手?

如果是两次握手,发送端可以确定自己发送的信息能对方能收到,也能确定对方发的包自己能收到,但接收端只能确定对方发的包自己能收到 无法确定自己发的包对方能收到

并且两次握手的话, 客户端有可能因为网络阻塞等原因会发送多个请求报文,延时到达的请求又会与服务器建立连接,浪费掉许多服务器的资源

# 二、四次挥手


tcp终止一个连接,需要经过四次挥手

过程如下:

  • 第一次挥手:客户端发送一个 FIN 报文,报文中会指定一个序列号。此时客户端处于 FIN_WAIT1 状态,停止发送数据,等待服务端的确认
  • 第二次挥手:服务端收到 FIN 之后,会发送 ACK 报文,且把客户端的序列号值 +1 作为 ACK 报文的序列号值,表明已经收到客户端的报文了,此时服务端处于 CLOSE_WAIT 状态
  • 第三次挥手:如果服务端也想断开连接了,和客户端的第一次挥手一样,发给 FIN 报文,且指定一个序列号。此时服务端处于 LAST_ACK 的状态
  • 第四次挥手:客户端收到 FIN 之后,一样发送一个 ACK 报文作为应答,且把服务端的序列号值 +1 作为自己 ACK 报文的序列号值,此时客户端处于 TIME_WAIT 状态。需要过一阵子以确保服务端收到自己的 ACK 报文之后才会进入 CLOSED 状态,服务端收到 ACK 报文之后,就处于关闭连接了,处于 CLOSED 状态

TCP四次挥手

四次挥手原因

服务端在收到客户端断开连接 Fin 报文后,并不会立即关闭连接,而是先发送一个 ACK 包先告诉客户端收到关闭连接的请求,只有当服务器的所有报文发送完毕之后,才发送 FIN 报文断开连接,因此需要四次挥手

# 总结


一个完整的三次握手四次挥手如下图所示:

TCP三次握手和四次挥手

Last Updated: 3/5/2022, 4:30:55 PM
+ + + diff --git a/Other/index.html b/Other/index.html new file mode 100644 index 0000000..084c0ca --- /dev/null +++ b/Other/index.html @@ -0,0 +1,85 @@ + + + + + + 其它 | Zzongke + + + + + + + + + +
+ + + diff --git "a/Other/video\351\274\240\346\240\207\347\247\273\345\212\250\351\242\204\350\247\210.html" "b/Other/video\351\274\240\346\240\207\347\247\273\345\212\250\351\242\204\350\247\210.html" new file mode 100644 index 0000000..22a624d --- /dev/null +++ "b/Other/video\351\274\240\346\240\207\347\247\273\345\212\250\351\242\204\350\247\210.html" @@ -0,0 +1,175 @@ + + + + + + video鼠标移动预览 | Zzongke + + + + + + + + + +

video鼠标移动预览

5/12/2022 Other

# video 鼠标移动预览

B 站图片接口 +https://api.bilibili.com/x/player/videoshot?aid=14326240

{
+  "code": 0,
+  "message": "0",
+  "ttl": 1,
+  "data": {
+    "pvdata": "//i0.hdslb.com/bfs/videoshot/23378913.bin",
+    "img_x_len": 10,
+    "img_y_len": 10,
+    "img_x_size": 160,
+    "img_y_size": 90,
+    "image": [
+      "//i0.hdslb.com/bfs/videoshot/23378913.jpg",
+      "//i0.hdslb.com/bfs/videoshot/23378913-1.jpg",
+      "//i0.hdslb.com/bfs/videoshot/23378913-2.jpg"
+    ],
+    "index": []
+  }
+}
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
字段 含义 详细 举例
data 缩略图
data.pvdata 一个二进制文件 缩略图,并不是每一秒都对应一张缩略图,而是每一段对应一张,这个字段应该是时间段与缩略图的对应方式 //i0.hdslb.com/bfs/videoshot/89359010.bin
data.img_x_len 每张雪碧图 x 方向图片数量 雪碧图是一个 10*10 的网格 10
data.img_y_len 每张雪碧图 y 方向图片数量 雪碧图是一个 10*10 的网格 10
data.img_x_size 单个缩略图图片的尺寸 x 轴 160
data.img_y_size 单个缩略图图片的尺寸 y 轴 90
data.image 雪碧图形式的所有缩略图 是一个数组,一次拿到所有的缩略图 ["//i0.hdslb.com/bfs/videoshot/89359010.jpg"]

# 代码

<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8" />
+    <title></title>
+    <link
+      rel="stylesheet"
+      href="./resources/font-awesome-4.7.0/css/font-awesome.min.css"
+    />
+    <link rel="stylesheet" type="text/css" href="./select/select.css" />
+    <style type="text/css">
+      #container {
+        position: absolute;
+        top: 0;
+        left: 0;
+        right: 0;
+        bottom: 0;
+        margin: auto;
+        width: 170px;
+        height: 95px;
+        background-image: url(20210223214102298jpg); //背景图图片
+        background-size: 1700px;
+      }
+    </style>
+  </head>
+  <body>
+    <div id="container"></div>
+    <script>
+      const container = document.querySelector("#container");
+      window.onload = function() {
+        // 鼠标移动到指定box上时,触发事件
+        //获取指定div元素
+        container.onmousemove = function(event) {
+          console.log("事件触发!");
+          // 获取盒子的位置
+          let boxX = container.offsetLeft;
+          let boxY = container.offsetTop;
+          // 获取鼠标的坐标
+          let pageX = event.pageX;
+          let pageY = event.pageY;
+          //计算鼠标在盒子中的坐标
+          let inBoxX = pageX - boxX;
+          let inBoxY = pageY - boxY;
+          // console.log("盒子中的坐标:x-->"+inBoxX+"--y-->"+inBoxY);
+          //计算X轴,并移动图片
+          //每移动5个值就改变一次图片
+          if (inBoxX % 5) {
+            //计算显示第几个图片
+            let imageIndex = parseInt(inBoxX / 5);
+            console.log("当前显示第几张图片:" + imageIndex);
+            //计算显示图片在大图中的位置
+            //计算显示图片的X轴(计算的是大图中的X轴)
+            let imageX = 170 * parseInt(imageIndex % 10);
+            //计算显示图片的Y轴(计算的是大图中的Y轴)
+            let imageY = 95 * parseInt(imageIndex / 10);
+            console.log("imageX:" + imageX);
+            console.log("imageY:" + imageY);
+            //修改背景图片
+            container.style.backgroundPosition =
+              "-" + imageX + "px" + " -" + imageY + "px";
+          }
+        };
+      };
+    </script>
+  </body>
+</html>
+
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
63
64
65
66

参考地址 +仿 BiliBili 视屏缩略图实现 (opens new window)

Last Updated: 5/12/2022, 1:06:42 PM
+ + + diff --git "a/Other/\345\234\260\345\235\200\346\240\217\350\276\223\345\205\245URL\346\225\262\344\270\213\345\233\236\350\275\246.html" "b/Other/\345\234\260\345\235\200\346\240\217\350\276\223\345\205\245URL\346\225\262\344\270\213\345\233\236\350\275\246.html" new file mode 100644 index 0000000..ee67f49 --- /dev/null +++ "b/Other/\345\234\260\345\235\200\346\240\217\350\276\223\345\205\245URL\346\225\262\344\270\213\345\233\236\350\275\246.html" @@ -0,0 +1,89 @@ + + + + + + 地址栏输入 URL 敲下回车 | Zzongke + + + + + + + + + +

地址栏输入 URL 敲下回车

3/5/2022 Other

# 一、简单分析


简单的分析,从输入 URL到回车后发生的行为如下:

  • URL 解析
  • DNS 查询
  • TCP 连接
  • HTTP 请求
  • 响应请求
  • 渲染页面

# 二、详细分析


# URL 解析

首先判断你输入的是一个合法的 URL 还是一个待搜索的关键词,并且根据你输入的内容进行对应操作

URL的解析第过程中的第一步,一个URL的结构解析如下:

url结构解析

# DNS 查询

在之前文章中讲过 DNS 的查询,这里就不再讲述了

整个查询过程如下图所示:

DNS的查询

最终,获取到了域名对应的目标服务器IP地址

# TCP 连接

在之前文章中,了解到tcp是一种面向有连接的传输层协议

在确定目标服务器服务器的IP地址后,则经历三次握手建立TCP连接,流程如下:

TCP的连接

# 发送 http 请求

当建立 tcp 连接之后,就可以在这基础上进行通信,浏览器发送 http 请求到目标服务器

请求的内容包括:

  • 请求行
  • 请求头
  • 请求主体

HTTP的请求

# 响应请求

当服务器接收到浏览器的请求之后,就会进行逻辑操作,处理完成之后返回一个HTTP响应消息,包括:

  • 状态行
  • 响应头
  • 响应正文

在服务器响应之后,由于现在http默认开始长连接keep-alive,当页面关闭之后,tcp链接则会经过四次挥手完成断开

# 页面渲染

当浏览器接收到服务器响应的资源后,首先会对资源进行解析:

  • 查看响应头的信息,根据不同的指示做对应处理,比如重定向,存储 cookie,解压 gzip,缓存资源等等
  • 查看响应头的 Content-Type 的值,根据不同的资源类型采用不同的解析方式

关于页面的渲染过程如下:

  • 解析 HTML,构建 DOM 树
  • 解析 CSS ,生成 CSS 规则树
  • 合并 DOM 树和 CSS 规则,生成 render 树
  • 布局 render 树( Layout / reflow ),负责各元素尺寸、位置的计算
  • 绘制 render 树( paint ),绘制页面像素信息
  • 浏览器会将各层的信息发送给 GPU,GPU 会将各层合成( composite ),显示在屏幕上

页面渲染

Last Updated: 6/14/2022, 4:00:06 PM
+ + + diff --git "a/Other/\346\250\241\347\263\212\346\220\234\347\264\242\345\205\263\351\224\256\350\257\215\351\253\230\344\272\256\346\230\276\347\244\272.html" "b/Other/\346\250\241\347\263\212\346\220\234\347\264\242\345\205\263\351\224\256\350\257\215\351\253\230\344\272\256\346\230\276\347\244\272.html" new file mode 100644 index 0000000..0e628d4 --- /dev/null +++ "b/Other/\346\250\241\347\263\212\346\220\234\347\264\242\345\205\263\351\224\256\350\257\215\351\253\230\344\272\256\346\230\276\347\244\272.html" @@ -0,0 +1,173 @@ + + + + + + 模糊搜索关键词高亮显示 | Zzongke + + + + + + + + + +

模糊搜索关键词高亮显示

3/1/2022 Other
<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
+    <title>auto complete</title>
+    <style>
+      bdi {
+        color: rgb(0, 136, 255);
+      }
+
+      li {
+        list-style: none;
+      }
+    </style>
+  </head>
+  <body>
+    <input class="inp" type="text" />
+    <section>
+      <ul class="container"></ul>
+    </section>
+  </body>
+  <script>
+    function debounce(fn, timeout = 300) {
+      let t;
+      return (...args) => {
+        if (t) {
+          clearTimeout(t);
+        }
+        t = setTimeout(() => {
+          fn.apply(fn, args);
+        }, timeout);
+      };
+    }
+
+    function memorize(fn) {
+      const cache = new Map();
+      return (name) => {
+        if (!name) {
+          container.innerHTML = "";
+          return;
+        }
+        if (cache.get(name)) {
+          container.innerHTML = cache.get(name);
+          return;
+        }
+        const res = fn.call(fn, name).join("");
+        cache.set(name, res);
+        container.innerHTML = res;
+      };
+    }
+
+    function handleInput(value) {
+      const reg = new RegExp(`\(${value}\)`);
+      const search = data.reduce((res, cur) => {
+        if (reg.test(cur)) {
+          const match = RegExp.$1;
+          res.push(`<li>${cur.replace(match, "<bdi>$&</bdi>")}</li>`);
+        }
+        return res;
+      }, []);
+      return search;
+    }
+
+    const data = [
+      "上海野生动物园",
+      "上饶野生动物园",
+      "北京巷子",
+      "上海中心",
+      "上海黄埔江",
+      "迪士尼上海",
+      "陆家嘴上海中心",
+    ];
+    const container = document.querySelector(".container");
+    const memorizeInput = memorize(handleInput);
+    document.querySelector(".inp").addEventListener(
+      "input",
+      debounce((e) => {
+        memorizeInput(e.target.value);
+      })
+    );
+  </script>
+</html>
+
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Last Updated: 3/5/2022, 4:30:55 PM
+ + + diff --git "a/Vue/30\351\201\223Vue\351\235\242\350\257\225\351\242\230.html" "b/Vue/30\351\201\223Vue\351\235\242\350\257\225\351\242\230.html" new file mode 100644 index 0000000..6ecfa09 --- /dev/null +++ "b/Vue/30\351\201\223Vue\351\235\242\350\257\225\351\242\230.html" @@ -0,0 +1,325 @@ + + + + + + 30 道 Vue 面试题 | Zzongke + + + + + + + + + +

30 道 Vue 面试题

3/15/2022 vue

# 1、说说你对 SPA 单页面的理解,它的优缺点分别是什么?


SPA(single-page application)仅在 Web 页面初始化时加载相应的 HTML、CSS、JavaScript。一旦页面加载完成,SPA 不会因为用户的操作二进行页面的重新加载或跳转;取而代之的是利用路由机制实现 HTML 内容的变换,UI 与用户交互,避免页面的重新加载。

优点:

  • 用户体验好、快,内容的改变不需要重新加载整个页面,避免了不必要的跳转和重复渲染。
  • 基于上面一点,SPA 相当于服务器压力小。
  • 前后端职责分离,架构清晰,前端进行交互逻辑,后端负责数据处理。

缺点:

  • 初次加载耗时多:为加载单页 Web 应用功能及显示效果,需要在加载页面的时候将 JavaScript 和 CSS 统一加载,部分页面按需加载。
  • 前进后退路由管理:由于单页应用在一个页面中显示所有的内容,所以不能使用浏览器的前进后退功能,所有的页面切换需要自己建立堆栈管理。
  • SEO 难度较大:由于所有的页面内容都在一个页面中动态替换显示,所以在 SEO 上其有着天然的弱势。

# 2、v-show 与 v-if 有什么区别?


v-if是真正的条件渲染,因为它会确保在切换过程中条件块内的事件监听器和子组件适当地被销毁和重建;也是惰性的:如果在初始渲染时条件为假,则什么也不做————知道条件第一次变为真时,才会开始渲染条件块。

v-show就简单得多————不管初始条件是什么,元素都会被渲染,并且只是简单的基于 CSS 的"display:none"属性进行切换。

所以,v-if适用于在运行时很少改变条件,不需要频繁切换条件的场景;v-show则适用于需要非常频繁切换条件的场景。

# 3、Class 与 Style 如何动态绑定?


Class 可以通过对象语法和数组语法进行动态绑定:

  • 对象语法:
<div v-bind:class="{ active: isActive, 'text-danger': hasError }"></div>
+
+data: { isActive: true, hasError: false }
+
1
2
3
  • 数组语法:
<div v-bind:class="[isActive ? activeClass : '', errorClass]"></div>
+
+data: { activeClass: 'active', errorClass: 'text-danger' }
+
1
2
3

Style 也可以通过对象语法和数组语法进行动态绑定:

  • 对象语法:
<div v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }"></div>
+
+data: { activeColor: 'red', fontSize: 30 }
+
1
2
3
  • 数组语法:
<div v-bind:style="[styleColor, styleSize]"></div>
+
+data: { styleColor: { color: 'red' }, styleSize:{ fontSize:'23px' } }
+
1
2
3

# 4、怎样理解 Vue 的单向数据流?


所有的 prop 都使得其父子 prop 之间形成了一个单向下行绑定:父级 prop 的更新会向下流动到子组件中,但是反过来不行。这样会防止从子组件意外改变父子组件的状态,从而导致你的应用的数据流向难以理解。

额外的,每次父级组件发生更新时,子组件中所有的 prop 都会刷新为最新的值。这意味着你不应该在一个子组件内部改变 prop。如果这样子做,Vue 会在浏览器的控制台发出警告。子组件想修改时,只能通过$emit 派发一个自定义事件,父组件接收到后,由父组件修改。

有两种常见的试图改变一个 prop 的情形 :

  • 这个 prop 用来传递一个初始值;这个子组件接下来希望将其作为一个本地的 prop 数据来使用。 在这种情况下,最好定义一个本地的 data 属性并将这个 prop 用作其初始值:
props: ['initialCounter'],
+data: function () {
+  return {
+    counter: this.initialCounter
+  }
+}
+
1
2
3
4
5
6
  • 这个 prop 以一种原始的值传入且需要进行转换。 在这种情况下,最好使用这个 prop 的值来定义一个计算属性
props: ['size'],
+computed: {
+  normalizedSize: function () {
+    return this.size.trim().toLowerCase()
+  }
+}
+
1
2
3
4
5
6

# 5、computed 和 watch 的区别和运用的场景?


computed:是计算属性,以来其它属性值,并且 computed 的值有缓存,只有它以来的属性值发生改变,下一次获取 computed 的值时才会重新计算 computed 的值;

watch:更多的是「观察」的作用,类似于某些数据的监听回调,每当监听的数据变化时都会执行回调进行后续的操作;

运用场景:

  • 当我们需要进行数值计算,并且依赖于其它数据时,应该使用 computed,因为可以利用 computed 的缓存特性,避免每次获取值时,都要重新计算;
  • 当我们需要在数据变化时执行异步或开销较大的操作时,应该使用 watch,使用 watch 选项允许我们执行异步操作(访问一个 API),限制我们执行该操作的频率,并在我们得到最终结果前,设置中间状态。这些都是计算属性无法做到的。

# 6、直接给一个数组赋值,Vue 能监测到变化吗?


由于 JavaScript 的限制,Vue 不能监测到以下数组的变动:

  • 当你利用索引直接设置一个数组项时,例如:vm.items[indexOfItem]=newValue
  • 当你修改数组长度时,例如:vm.items.length = newLength

为了解决第一个问题,Vue 提供了以下操作方法:

//Vue.set
+Vue.set(vm.items, indexOfItem, newValue);
+//vm.$set
+vm.$set(vm.items, indexOfItem, newValue);
+//Array.prototype.splice
+vm.items.splice(indexOfItem, 1, newValue);
+
1
2
3
4
5
6

为了解决第二个问题,Vue 提供了以下操作方法:

//Array.prototype.splice
+vm.items.splice(newLength);
+
1
2

# 7、谈谈你对 Vue 生命周期的理解?


# (1)生命周期是什么?

Vue 实例有一个完整的生命周期,也就是从开始创建、初始化数据、编译模板、挂载 DOM->渲染、更新->渲染、卸载等一些列过程,我们称这是 Vue 的生命周期。

# (2)各个生命周期的作用?

生命周期 描述
beforeCreate 组件实例被创建之初,组件的属性生效之前
created 组件实例已经完全创建,属性也绑定,但真实 DOM 还没有生成,$el 还不可用
beforeMount 在挂载开始之前被调用:相关的 render 函数首次被调用
mounted el 被新创建的 vm.$el 替换,并挂载到实例上去之后调用该钩子
beforeUpdate 组件数据更新之前被调用,发生在虚拟 DOM 打补丁之前
update 组件数据更新之后
activited keep-alive 专属,组件被激活时调用
deactivated keep-alive 专属,组件被销毁时调用
beforeDestory 组件销毁前调用
destoryed 组件销毁后调用

# (3)生命周期示意图

Vue生命周期示意图

# 8、Vue 的父组件和子组件生命周期钩子函数执行顺序?


Vue 的父组件和子组件生命周期钩子函数执行顺序可以归类为以下 4 部分:

  • 加载渲染过程

父 beforeCreate -> 父 created -> 父 beforeMount -> 子 beforeCreate -> 子 created -> 子 beforeMount -> 子 mounted -> 父 mounted

  • 子组件更新过程

父 beforeUpdate -> 子 beforeUpdate -> 子 updated -> 父 updated

  • 父组件更新过程

父 beforeUpdate -> 父 updated

  • 销毁过程

父 beforeDestroy -> 子 beforeDestroy -> 子 destroyed -> 父 destroyed

# 9、在哪个生命周期内调用异步请求?


可以在钩子函数 created、beforeMount、mounted 中进行调用,因为在这三个钩子函数中,data 已经创建,可以将服务端端返回的数据进行赋值。但是本人推荐在 created 钩子函数中调用异步请求,因为在 created 钩子函数中调用异步请求有以下优点:

  • 能更快获取到服务端数据,减少页面 loading 时间;
  • SSR 不支持 beforeMount、mounted 钩子函数,所以放在 created 中有助于一致性;

# 10、在什么阶段才能访问操作 DOM?


在钩子函数 mounted 被调用前,Vue 已经将编译好的模板挂载到页面上,所以在 mounted 中可以访问操作 DOM。

# 11、父组件可以监听到子组件的生命周期吗?


比如有父组件 Parent 和子组件 Child,如果父组件监听到子组件挂载 mounted 就做一些逻辑处理,可以通过以下写法实现:

// Parent.vue
+<Child @mounted="doSomething"/>
+
+// Child.vue
+mounted() {
+  this.$emit("mounted");
+}
+
1
2
3
4
5
6
7

以上需要手动通过 $emit 触发父组件的事件,更简单的方式可以在父组件引用子组件时通过 @hook 来监听即可,如下所示:

//  Parent.vue
+<Child @hook:mounted="doSomething" ></Child>
+
+doSomething() {
+   console.log('父组件监听到 mounted 钩子函数 ...');
+},
+
+//  Child.vue
+mounted(){
+   console.log('子组件触发 mounted 钩子函数 ...');
+},
+
+// 以上输出顺序为:
+// 子组件触发 mounted 钩子函数 ...
+// 父组件监听到 mounted 钩子函数 ...
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

当然 @hook 方法不仅仅是可以监听 mounted,其它的生命周期事件,例如:created,updated 等都可以监听。

# 12、谈谈你对 keep-alive 的了解?


keep-alive 是 Vue 内置的一个组件,可以使被包含的组件保留状态,避免重新渲染 ,其有以下特性:

  • 一般结合路由和动态组件一起使用,用于缓存组件;
  • 提供 include 和 exclude 属性,两者都支持字符串或正则表达式, include 表示只有名称匹配的组件会被缓存,exclude 表示任何名称匹配的组件都不会被缓存 ,其中 exclude 的优先级比 include 高;
  • 对应两个钩子函数 activated 和 deactivated ,当组件被激活时,触发钩子函数 activated,当组件被移除时,触发钩子函数 deactivated。

# 13、组件中 data 为什么是一个函数?


为什么组件中的 data 必须是一个函数,然后 return 一个对象,而 new Vue 实例里,data 可以直接是一个对象?

// data
+data() {
+  return {
+	message: "子组件",
+	childName:this.name
+  }
+}
+
+// new Vue
+new Vue({
+  el: '#app',
+  router,
+  template: '<App/>',
+  components: {App}
+})
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

因为组件是用来复用的,且 JS 里对象是引用关系,如果组件中 data 是一个对象,那么这样作用域没有隔离,子组件中的 data 属性值会相互影响,如果组件中 data 选项是一个函数,那么每个实例可以维护一份被返回对象的独立的拷贝,组件实例之间的 data 属性值不会互相影响;而 new Vue 的实例,是不会被复用的,因此不存在引用对象的问题。

# 14、v-model 的原理?


我们在 vue 项目中主要使用 v-model 指令在表单 input、textarea、select 等元素上创建双向数据绑定,我们知道 v-model 本质上不过是语法糖,v-model 在内部为不同的输入元素使用不同的属性并抛出不同的事件:

  • text 和 textarea 元素使用 value 属性和 input 事件;
  • checkbox 和 radio 使用 checked 属性和 change 事件;
  • select 字段将 value 作为 prop 并将 change 作为事件。

以 input 表单元素为例:

<input v-model='something'>
+
+相当于
+
+<input v-bind:value="something" v-on:input="something = $event.target.value">
+
1
2
3
4
5

如果在自定义组件中,v-model 默认会利用名为 value 的 prop 和名为 input 的事件,如下所示:

父组件:
+<ModelChild v-model="message"></ModelChild>
+
+子组件:
+<div>{{value}}</div>
+
+props:{
+    value: String
+},
+methods: {
+  test1(){
+     this.$emit('input', '小红')
+  },
+},
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# 15、Vue 组件间通信有哪几种方式?


Vue 组件间通信只要指以下 3 类通信:父子组件通信、隔代组件通信、兄弟组件通信,下面我们分别介绍每种通信方式且会说明此种方法可适用于哪类组件间通信。

# (1)props / $emit 适用 父子组件通信

# (2)ref$parent / $children 适用 父子组件通信

  • ref:如果在普通的 DOM 元素上使用,引用指向的就是 DOM 元素;如果用在子组件上,引用就指向组件实例
  • $parent / $children:访问父 / 子实例

# (3)EventBus$emit / $on) 适用于 父子、隔代、兄弟组件通信

这种方法通过一个空的 Vue 实例作为中央事件总线(事件中心),用它来触发事件和监听事件,从而实现任何组件间的通信,包括父子、隔代、兄弟组件。

# (4)$attrs/$listeners 适用于 隔代组件通信

  • $attrs:包含了父作用域中不被 prop 所识别 (且获取) 的特性绑定 ( class 和 style 除外 )。当一个组件没有声明任何 prop 时,这里会包含所有父作用域的绑定 ( class 和 style 除外 ),并且可以通过 v-bind="$attrs" 传入内部组件。通常配合 inheritAttrs 选项一起使用。
  • $listeners:包含了父作用域中的 (不含 .native 修饰器的) v-on 事件监听器。它可以通过 v-on="$listeners" 传入内部组件

# (5)provide / inject 适用于 隔代组件通信

祖先组件中通过 provider 来提供变量,然后在子孙组件中通过 inject 来注入变量。 provide / inject API 主要解决了跨级组件间的通信问题,不过它的使用场景,主要是子组件获取上级组件的状态,跨级组件间建立了一种主动提供与依赖注入的关系。

# (6)Vuex 适用于 父子、隔代、兄弟组件通信

Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式。每一个 Vuex 应用的核心就是 store(仓库)。“store” 基本上就是一个容器,它包含着你的应用中大部分的状态 ( state )。

  • Vuex 的状态存储是响应式的。当 Vue 组件从 store 中读取状态的时候,若 store 中的状态发生变化,那么相应的组件也会相应地得到高效更新。
  • 改变 store 中的状态的唯一途径就是显式地提交 (commit) mutation。这样使得我们可以方便地跟踪每一个状态的变化。

# 16、你使用过 Vuex 吗?


Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式。每一个 Vuex 应用的核心就是 store(仓库)。“store” 基本上就是一个容器,它包含着你的应用中大部分的状态 ( state )。

(1)Vuex 的状态存储是响应式的。当 Vue 组件从 store 中读取状态的时候,若 store 中的状态发生变化,那么相应的组件也会相应地得到高效更新。

(2)改变 store 中的状态的唯一途径就是显式地提交 (commit) mutation。这样使得我们可以方便地跟踪每一个状态的变化。

  • State:定义了应用状态的数据结构,可以在这里设置默认的初始状态。
  • Getter:允许组件从 Store 中获取数据,mapGetters 辅助函数仅仅是将 store 中的 getter 映射到局部计算属性。
  • Mutation:是唯一更改 store 中状态的方法,且必须是同步函数。
  • Action:用于提交 mutation,而不是直接变更状态,可以包含任意异步操作。
  • Module:允许将单一的 Store 拆分为多个 store 且同时保存在单一的状态树中。

# 17、使用过 Vue SSR 吗?说说 SSR?


Vue.js 是构建客户端应用程序的框架。默认情况下,可以在浏览器中输出 Vue 组件,进行生成 DOM 和操作 DOM。然而,也可以将同一个组件渲染为服务端的 HTML 字符串,将它们直接发送到浏览器,最后将这些静态标记"激活"为客户端上完全可交互的应用程序。
即:SSR 大致的意思就是 vue 在客户端将标签渲染成的整个 html 片段的工作在服务端完成,服务端形成的 html 片段直接返回给客户端这个过程就叫做服务端渲染。

服务端渲染 SSR 的优缺点如下:

(1)服务端渲染的优点:

  • 更好的 SEO: 因为 SPA 页面的内容是通过 Ajax 获取,而搜索引擎爬取工具并不会等待 Ajax 异步完成后再抓取页面内容,所以在 SPA 中是抓取不到页面通过 Ajax 获取到的内容;而 SSR 是直接由服务端返回已经渲染好的页面(数据已经包含在页面中),所以搜索引擎爬取工具可以抓取渲染好的页面;
  • 更快的内容到达时间(首屏加载更快): SPA 会等待所有 Vue 编译后的 js 文件都下载完成后,才开始进行页面的渲染,文件下载等需要一定的时间等,所以首屏渲染需要一定的时间;SSR 直接由服务端渲染好页面直接返回显示,无需等待下载 js 文件及再去渲染等,所以 SSR 有更快的内容到达时间;

(2) 服务端渲染的缺点:

  • 更多的开发条件限制: 例如服务端渲染只支持 beforCreate 和 created 两个钩子函数,这会导致一些外部扩展库需要特殊处理,才能在服务端渲染应用程序中运行;并且与可以部署在任何静态文件服务器上的完全静态单页面应用程序 SPA 不同,服务端渲染应用程序,需要处于 Node.js server 运行环境;
  • 更多的服务器负载:在 Node.js 中渲染完整的应用程序,显然会比仅仅提供静态文件的 server 更加大量占用 CPU 资源 (CPU-intensive - CPU 密集),因此如果你预料在高流量环境 ( high traffic ) 下使用,请准备相应的服务器负载,并明智地采用缓存策略。

# 18、vue-router 路由模式有几种?


vue-router 有 3 种路由模式:hash、history、abstract,对应的源码如下所示:

switch (mode) {
+  case "history":
+    this.history = new HTML5History(this, options.base);
+    break;
+  case "hash":
+    this.history = new HashHistory(this, options.base, this.fallback);
+    break;
+  case "abstract":
+    this.history = new AbstractHistory(this, options.base);
+    break;
+  default:
+    if (process.env.NODE_ENV !== "production") {
+      assert(false, `invalid mode: ${mode}`);
+    }
+}
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

其中,3 种路由模式的说明如下:

  • hash: 使用 URL hash 值来作路由。支持所有浏览器,包括不支持 HTML5 History Api 的浏览器;
  • history : 依赖 HTML5 History API 和服务器配置。具体可以查看 HTML5 History 模式;
  • abstract : 支持所有 JavaScript 运行环境,如 Node.js 服务器端。如果发现没有浏览器的 API,路由会自动强制进入这个模式.

# 19、能说下 vue-router 中常用的 hash 和 history 路由模式实现原理吗?


# (1)hash 模式的实现原理

早期的前端路由的实现就是基于 location.hash 来实现的。其实现原理很简单,location.hash 的值就是 URL 中 # 后面的内容。比如下面这个网站,它的 location.hash 的值为 '#search':

https://www.word.com#search
+
1

hash 路由模式的实现主要是基于下面几个特性:

  • URL 中 hash 值只是客户端的一种状态,也就是说当向服务器端发出请求时,hash 部分不会被发送;
  • hash 值的改变,都会在浏览器的访问历史中增加一个记录。因此我们能通过浏览器的回退、前进按钮控制 hash 的切换;
  • 可以通过 a 标签,并设置 href 属性,当用户点击这个标签后,URL 的 hash 值会发生改变;或者使用 JavaScript 来对 loaction.hash 进行赋值,改变 URL 的 hash 值;
  • 我们可以使用 hashchange 事件来监听 hash 值的变化,从而对页面进行跳转(渲染)。

# (2)history 模式的实现原理

HTML5 提供了 History API 来实现 URL 的变化。其中做最主要的 API 有以下两个:history.pushState() 和 history.repalceState()。这两个 API 可以在不进行刷新的情况下,操作浏览器的历史纪录。唯一不同的是,前者是新增一个历史记录,后者是直接替换当前的历史记录,如下所示:

window.history.pushState(null, null, path);
+window.history.replaceState(null, null, path);
+
1
2

history 路由模式的实现主要基于存在下面几个特性:

  • pushState 和 repalceState 两个 API 来操作实现 URL 的变化 ;
  • 我们可以使用 popstate 事件来监听 url 的变化,从而对页面进行跳转(渲染);
  • history.pushState() 或 history.replaceState() 不会触发 popstate 事件,这时我们需要手动触发页面跳转(渲染)。

# 20、什么是 MVVM?


Model–View–ViewModel (MVVM)是一种软件架构设计模式,有微软 WPF 和 Silverlight 的架构师 Ken Cooper 和 Ted Peters 开发,是一种简化用户界面的事件驱动编程方式。由 John Gossman(同样也是 WPF 和 Silverlight 的架构师)于 2005 年在他的博客发表

MVVM 源自于经典的 Model-View-Controller(MVC)模式,MVVM 的出现促进了前端开发与后端业务逻辑的分离,极大的提高了前端开发效率,MVVM 的核心是 ViewModel 层,它就像是一个中转站(value converter),负责转换 Model 中的数据对象来让数据变得更容易管理和使用,该层向上与视图层进行双向绑定,向下与 Model 层通过接口请求进行数据交互,启呈上启下作用,如下:

什么是 MVVM?

# (1)View 层

View 是视图层,也就是用户界面。前端主要由 HTML 和 CSS 来构建。

# (2)Model 层

Model 是指数据模型,泛指后端进行的各种业务逻辑处理和数据操控,对于前端来说就是后端提供的 api 接口。

# (3)ViewModel 层

ViewModel 是由前端开发人员组织生成和维护的视图数据层。在这一层,前端开发者对从后端获取的 Model 数据进行转换处理,做二次封装,以生成符合 View 层使用预期的视图数据模型。需要注意的是 ViewModel 所封装出来的数据模型包括视图的状态和行为两部分,而 Model 层的数据模型是只包含状态的,比如页面的这一块展示什么,而页面加载进来时发生什么,点击这一块发生什么,这一块滚动时发生什么这些都属于视图行为(交互),视图状态和行为都封装在了 ViewModel 里。这样的封装使得 ViewModel 可以完整地去描述 View 层。

MVVM 框架实现了双向绑定,这样 ViewModel 的内容会实时展现在 View 层,前端开发者再也不必低效又麻烦地通过操纵 DOM 去更新视图,MVVM 框架已经把最脏最累的一块做好了,我们开发者只需要处理和维护 ViewModel,更新数据视图就会自动得到相应更新。这样 View 层展现的不是 Model 层的数据,而是 ViewModel 的数据,由 ViewModel 负责与 Model 层交互,这就完全解耦了 View 层和 Model 层,这个解耦是至关重要的,它是前后端分离方案实施的重要一环。

我们以下通过一个 Vue 实例来说明 MVVM 的具体实现,有 Vue 开发经验的同学应该一目了然:

(1)View 层

<div id="app">
+  <p>{{message}}</p>
+  <button v-on:click="showMessage()">Click me</button>
+</div>
+
1
2
3
4

(2)ViewModel 层

var app = new Vue({
+  el: "#app",
+  data: {
+    // 用于描述视图状态
+    message: "Hello Vue!",
+  },
+  methods: {
+    // 用于描述视图行为
+    showMessage() {
+      let vm = this;
+      alert(vm.message);
+    },
+  },
+  created() {
+    let vm = this;
+    // Ajax 获取 Model 层的数据
+    ajax({
+      url: "/your/server/data/api",
+      success(res) {
+        vm.message = res;
+      },
+    });
+  },
+});
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

(3) Model 层

{
+  "url": "/your/server/data/api",
+  "res": {
+    "success": true,
+    "name": "IoveC",
+    "domain": "www.cnblogs.com"
+  }
+}
+
1
2
3
4
5
6
7
8

# 21、Vue 是如何实现数据双向绑定的?


Vue 数据双向绑定主要是指:数据变化更新视图,视图变化更新数据,如下图所示:

Vue 是如何实现数据双向绑定的?

即:

  • 输入框内容变化时,Data 中的数据同步变化。即 View => Data 的变化。
  • Data 中的数据变化时,文本节点的内容同步变化。即 Data => View 的变化。

其中,View 变化更新 Data ,可以通过事件监听的方式来实现,所以 Vue 的数据双向绑定的工作主要是如何根据 Data 变化更新 View。

Vue 主要通过以下 4 个步骤来实现数据双向绑定的:

实现一个监听器 Observer:对数据对象进行遍历,包括子属性对象的属性,利用 Object.defineProperty() 对属性都加上 setter 和 getter。这样的话,给这个对象的某个值赋值,就会触发 setter,那么就能监听到了数据变化。

实现一个解析器 Compile:解析 Vue 模板指令,将模板中的变量都替换成数据,然后初始化渲染页面视图,并将每个指令对应的节点绑定更新函数,添加监听数据的订阅者,一旦数据有变动,收到通知,调用更新函数进行数据更新。

实现一个订阅者 Watcher:Watcher 订阅者是 Observer 和 Compile 之间通信的桥梁 ,主要的任务是订阅 Observer 中的属性值变化的消息,当收到属性值变化的消息时,触发解析器 Compile 中对应的更新函数。

实现一个订阅器 Dep:订阅器采用 发布-订阅 设计模式,用来收集订阅者 Watcher,对监听器 Observer 和 订阅者 Watcher 进行统一管理。

Vue 是如何实现数据双向绑定的?

# 22、Vue 框架怎么实现对象和数组的监听?


如果被问到 Vue 怎么实现数据双向绑定,大家肯定都会回答 通过 Object.defineProperty() 对数据进行劫持,但是 Object.defineProperty() 只能对属性进行数据劫持,不能对整个对象进行劫持,同理无法对数组进行劫持,但是我们在使用 Vue 框架中都知道,Vue 能检测到对象和数组(部分方法的操作)的变化,那它是怎么实现的呢?我们查看相关代码如下:

  /**
+   * Observe a list of Array items.
+   */
+  observeArray (items: Array<any>) {
+    for (let i = 0, l = items.length; i < l; i++) {
+      observe(items[i])  // observe 功能为监测数据的变化
+    }
+  }
+
+  /**
+   * 对属性进行递归遍历
+   */
+  let childOb = !shallow && observe(val) // observe 功能为监测数据的变化
+
1
2
3
4
5
6
7
8
9
10
11
12
13

通过以上 Vue 源码部分查看,我们就能知道 Vue 框架是通过遍历数组 和递归遍历对象,从而达到利用 Object.defineProperty() 也能对对象和数组(部分方法的操作)进行监听。

# 23、Proxy 与 Object.defineProperty 优劣对比


Proxy 的优势如下:

  • Proxy 可以直接监听对象而非属性;
  • Proxy 可以直接监听数组的变化;
  • Proxy 有多达 13 种拦截方法,不限于 apply、ownKeys、deleteProperty、has 等等是 Object.defineProperty 不具备的;
  • Proxy 返回的是一个新对象,我们可以只操作新的对象达到目的,而 Object.defineProperty 只能遍历对象属性直接修改;
  • Proxy 作为新标准将受到浏览器厂商重点持续的性能优化,也就是传说中的新标准的性能红利;

Object.defineProperty 的优势如下:

  • 兼容性好,支持 IE9,而 Proxy 的存在浏览器兼容性问题,而且无法用 polyfill 磨平,因此 Vue 的作者才声明需要等到下个大版本( 3.0 )才能用 Proxy 重写。

# 24、Vue 怎么用 vm.$set() 解决对象新增属性不能响应的问题 ?


受现代 JavaScript 的限制 ,Vue  无法检测到对象属性的添加或删除。由于 Vue 会在初始化实例时对属性执行 getter/setter 转化,所以属性必须在 data  对象上存在才能让 Vue 将它转换为响应式的。但是 Vue 提供了 Vue.set (object, propertyName, value) / vm.$set (object, propertyName, value) 来实现为对象添加响应式属性,那框架本身是如何实现的呢?

我们查看对应的 Vue 源码:vue/src/core/instance/index.js

export function set(target: Array<any> | Object, key: any, val: any): any {
+  // target 为数组
+  if (Array.isArray(target) && isValidArrayIndex(key)) {
+    // 修改数组的长度, 避免索引>数组长度导致splcie()执行有误
+    target.length = Math.max(target.length, key);
+    // 利用数组的splice变异方法触发响应式
+    target.splice(key, 1, val);
+    return val;
+  }
+  // key 已经存在,直接修改属性值
+  if (key in target && !(key in Object.prototype)) {
+    target[key] = val;
+    return val;
+  }
+  const ob = (target: any).__ob__;
+  // target 本身就不是响应式数据, 直接赋值
+  if (!ob) {
+    target[key] = val;
+    return val;
+  }
+  // 对属性进行响应式处理
+  defineReactive(ob.value, key, val);
+  ob.dep.notify();
+  return val;
+}
+
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

我们阅读以上源码可知,vm.$set 的实现原理是:

  • 如果目标是数组,直接使用数组的 splice 方法触发响应式;
  • 如果目标是对象,会先判读属性是否存在、对象是否是响应式,最终如果要对属性进行响应式处理,则是通过调用 defineReactive 方法进行响应式处理( defineReactive 方法就是 Vue 在初始化对象时,给对象属性采用 Object.defineProperty 动态添加 getter 和 setter 的功能所调用的方法)

# 25、虚拟 DOM 的优缺点?


优点:

  • 保证性能下限: 框架的虚拟 DOM 需要适配任何上层 API 可能产生的操作,它的一些 DOM 操作的实现必须是普适的,所以它的性能并不是最优的;但是比起粗暴的 DOM 操作性能要好很多,因此框架的虚拟 DOM 至少可以保证在你不需要手动优化的情况下,依然可以提供还不错的性能,即保证性能的下限;
  • 无需手动操作 DOM: 我们不再需要手动去操作 DOM,只需要写好 View-Model 的代码逻辑,框架会根据虚拟 DOM 和 数据双向绑定,帮我们以可预期的方式更新视图,极大提高我们的开发效率;
  • 跨平台: 虚拟 DOM 本质上是 JavaScript 对象,而 DOM 与平台强相关,相比之下虚拟 DOM 可以进行更方便地跨平台操作,例如服务器渲染、weex 开发等等。

缺点:

  • 无法进行极致优化: 虽然虚拟 DOM + 合理的优化,足以应对绝大部分应用的性能需求,但在一些性能要求极高的应用中虚拟 DOM 无法进行针对性的极致优化。

# 26、虚拟 DOM 实现原理?


虚拟 DOM 的实现原理主要包括以下 3 部分:

  • 用 JavaScript 对象模拟真实 DOM 树,对真实 DOM 进行抽象;
  • diff 算法 — 比较两棵虚拟 DOM 树的差异;
  • pach 算法 — 将两个虚拟 DOM 对象的差异应用到真正的 DOM 树。

# 27、Vue 中的 key 有什么作用?


key 是为 Vue 中 vnode 的唯一标记,通过这个 key,我们的 diff 操作可以更准确、更快速。Vue 的 diff 过程可以概括为:oldCh 和 newCh 各有两个头尾的变量 oldStartIndex、oldEndIndex 和 newStartIndex、newEndIndex,它们会新节点和旧节点会进行两两对比,即一共有 4 种比较方式:newStartIndex 和 oldStartIndex 、newEndIndex 和 oldEndIndex 、newStartIndex 和 oldEndIndex 、newEndIndex 和 oldStartIndex,如果以上 4 种比较都没匹配,如果设置了 key,就会用 key 再进行比较,在比较的过程中,遍历会往中间靠,一旦 StartIdx > EndIdx 表明 oldCh 和 newCh 至少有一个已经遍历完了,就会结束比较。具体有无 key 的 diff 过程,可以查看作者写的另一篇详解虚拟 DOM 的文章《深入剖析:Vue 核心之虚拟 DOM》

所以 Vue 中 key 的作用是:key 是为 Vue 中 vnode 的唯一标记,通过这个 key,我们的 diff 操作可以更准确、更快速

更准确:因为带 key 就不是就地复用了,在 sameNode 函数 a.key === b.key 对比中可以避免就地复用的情况。所以会更加准确。

更快速:利用 key 的唯一性生成 map 对象来获取对应节点,比遍历方式更快,源码如下:

function createKeyToOldIdx(children, beginIdx, endIdx) {
+  let i, key;
+  const map = {};
+  for (i = beginIdx; i <= endIdx; ++i) {
+    key = children[i].key;
+    if (isDef(key)) map[key] = i;
+  }
+  return map;
+}
+
1
2
3
4
5
6
7
8
9

# 28、你有对 Vue 项目进行哪些优化?


# (1)代码层面的优化

  • v-if 和 v-show 区分使用场景
  • computed 和 watch 区分使用场景
  • v-for 遍历必须为 item 添加 key,且避免同时使用 v-if
  • 长列表性能优化
  • 事件的销毁
  • 图片资源懒加载
  • 路由懒加载
  • 第三方插件的按需引入
  • 优化无限列表性能
  • 服务端渲染 SSR or 预渲染

# (2)Webpack 层面的优化

  • Webpack 对图片进行压缩
  • 减少 ES6 转为 ES5 的冗余代码
  • 提取公共代码
  • 模板预编译
  • 提取组件的 CSS
  • 优化 SourceMap
  • 构建结果输出分析
  • Vue 项目的编译优化

# (3)基础的 Web 技术的优化

  • 开启 gzip 压缩
  • 浏览器缓存
  • CDN 的使用
  • 使用 Chrome Performance 查找性能瓶颈

# 29、对于即将到来的 vue3.0 特性你有什么了解的吗?


Vue 3.0 正走在发布的路上,Vue 3.0 的目标是让 Vue 核心变得更小、更快、更强大,因此 Vue 3.0 增加以下这些新特性:

# (1)监测机制的改变

3.0 将带来基于代理 Proxy 的 observer 实现,提供全语言覆盖的反应性跟踪。这消除了 Vue 2 当中基于 Object.defineProperty 的实现所存在的很多限制:

  • 只能监测属性,不能监测对象
  • 检测属性的添加和删除
  • 检测数组索引和长度的变更
  • 支持 Map、Set、WeakMap 和 WeakSet

新的 observer 还提供了以下特性:

  • 用于创建 observable 的公开 API。这为中小规模场景提供了简单轻量级的跨组件状态管理解决方案。
  • 默认采用惰性观察。在 2.x 中,不管反应式数据有多大,都会在启动时被观察到。如果你的数据集很大,这可能会在应用启动时带来明显的开销。在 3.x 中,只观察用于渲染应用程序最初可见部分的数据。
  • 更精确的变更通知。在 2.x 中,通过 Vue.set 强制添加新属性将导致依赖于该对象的 watcher 收到变更通知。在 3.x 中,只有依赖于特定属性的 watcher 才会收到通知。
  • 不可变的 observable:我们可以创建值的“不可变”版本(即使是嵌套属性),除非系统在内部暂时将其“解禁”。这个机制可用于冻结 prop 传递或 Vuex 状态树以外的变化。
  • 更好的调试功能:我们可以使用新的 renderTracked 和 renderTriggered 钩子精确地跟踪组件在什么时候以及为什么重新渲染。

# (2)模板

模板方面没有大的变更,只改了作用域插槽,2.x 的机制导致作用域插槽变了,父组件会重新渲染,而 3.0 把作用域插槽改成了函数的方式,这样只会影响子组件的重新渲染,提升了渲染的性能。

同时,对于 render 函数的方面,vue3.0 也会进行一系列更改来方便习惯直接使用 api 来生成 vdom 。

# (3)对象式的组件声明方式

vue2.x 中的组件是通过声明的方式传入一系列 option,和 TypeScript 的结合需要通过一些装饰器的方式来做,虽然能实现功能,但是比较麻烦。3.0 修改了组件的声明方式,改成了类式的写法,这样使得和 TypeScript 的结合变得很容易。

此外,vue 的源码也改用了 TypeScript 来写。其实当代码的功能复杂之后,必须有一个静态类型系统来做一些辅助管理。现在 vue3.0 也全面改用 TypeScript 来重写了,更是使得对外暴露的 api 更容易结合 TypeScript。静态类型系统对于复杂代码的维护确实很有必要。

# (4)其它方面的更改

vue3.0 的改变是全面的,上面只涉及到主要的 3 个方面,还有一些其他的更改:

  • 支持自定义渲染器,从而使得 weex 可以通过自定义渲染器的方式来扩展,而不是直接 fork 源码来改的方式。
  • 支持 Fragment(多个根节点)和 Protal(在 dom 其他部分渲染组建内容)组件,针对一些特殊的场景做了处理。
  • 基于 treeshaking 优化,提供了更多的内置功能。

# 30、手写 Promise.all 和 Promise.race


# Promise.all()

核心思路:

1、Promise.all 返回的肯定是一个 Promise 对象,所以可以直接写一个 return new Promise((resolve,reject)=>{})(这应该是一个惯性思维) +2、遍历传入的参数,用 Promise.resolve()将参数“包一层”,使其变成个 Promise 对象 +3、关键点是何时“决议”,也就是合适 resolve 出来,在这里做了计数器(count),每个内部 Promise 对象决议后就将计数器加一,并判断加一后的大小是否与传入对象的数量相等,如果相等则调用 resolve,如果任何一个 promise 对象失败,则调用 reject()方法。 +4、官网规定 Promise.all()接受的参数是一个可遍历的参数,所以未必一定是一个数组,所以用 Array.from()转化一下 +5、使用 for...of 进行遍历,因为凡事可遍历的变量应该都是部署了 iterator 方法,所以用 for...of 遍历最安全

Promise.all = function (iterater) {
+  let count = 0;
+  let len = iterater.length;
+  let res = [];
+  return new Promise((resolve, reject) => {
+    for (item of iterater) {
+      Promise.resolve(iterater[item])
+        .then((data) => {
+          res[item] = data;
+          if (++count === len) {
+            resolve(res);
+          }
+        })
+        .catch((err) => reject(err));
+    }
+  });
+};
+const promise1 = Promise.resolve(3);
+const promise2 = new Promise((resolve, reject) => {
+  setTimeout(resolve, 100, "foo");
+});
+const promise3 = 42;
+Promise.all([promise1, promise2, promise3]).then((values) =>
+  console.log(values)
+);
+
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

# Promise.race()

核心思路: +谁先决议那么就返回谁,所以将 all 的计数器和逻辑判断全部去除掉就可以了。

romise.race = function (iterater) {
+  return new Promise((resolve, reject) => {
+    for (item of iterater) {
+      Promise.resolve(iterater[item])
+        .then((data) => {
+          resolve(res);
+        })
+        .catch((err) => reject(err));
+    }
+  });
+};
+const promise1 = Promise.resolve(3);
+const promise2 = new Promise((resolve, reject) => {
+  setTimeout(resolve, 100, "foo");
+});
+const promise3 = 42;
+Promise.race([promise1, promise2, promise3]).then((values) =>
+  console.log(values)
+);
+
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Last Updated: 6/14/2022, 4:00:06 PM
+ + + diff --git "a/Vue/Vue\345\270\270\350\247\201\351\227\256\351\242\230.html" "b/Vue/Vue\345\270\270\350\247\201\351\227\256\351\242\230.html" new file mode 100644 index 0000000..053b673 --- /dev/null +++ "b/Vue/Vue\345\270\270\350\247\201\351\227\256\351\242\230.html" @@ -0,0 +1,87 @@ + + + + + + Vue常见问题 | Zzongke + + + + + + + + + +
+ + + diff --git a/Vue/index.html b/Vue/index.html new file mode 100644 index 0000000..2405e1f --- /dev/null +++ b/Vue/index.html @@ -0,0 +1,85 @@ + + + + + + Zzongke + + + + + + + + + +
+ + + diff --git a/Vue/nextTick.html b/Vue/nextTick.html new file mode 100644 index 0000000..3a2c603 --- /dev/null +++ b/Vue/nextTick.html @@ -0,0 +1,168 @@ + + + + + + Vue的nextTick源码解析 | Zzongke + + + + + + + + + +

Vue的nextTick源码解析

2/16/2022 vue

nextTick 支持两种形式使用方式:

  1. 回调函数形式。
  2. 如果当前环节支持 Promise,还支持 Promise.then 的形式。
let pending = false,
+timeFunc,
+callbacks=[];
+
+//cb:执行的回调函数,context:执行上下文参数
+function nextTick(cb,context){
+  let _resolve=null;
+  callbacks.push(()=>{
+    if(cb){
+      try{
+        cb.call(context)
+      }catch(e){
+        handleError(e,ctx,'nextTick)
+      }
+    }else if(_resolve){
+      _resolve(context)
+    }
+  })
+  if(!pending){
+    pending=true;
+    timeFunc()
+  }
+  if(!cb&&typeof Promise !== "undefind"){
+    rteurn new Promise(resolve=>_resolve=resolve)
+  }
+}
+
+let isUsingMicroTask = false;
+if (typeof Promise !== 'undefined' && isNative(Promise)) {
+  //判断1:是否原生支持Promise
+  const p = Promise.resolve()
+  timerFunc = () => {
+    p.then(flushCallbacks)
+    if (isIOS) setTimeout(noop)
+  }
+  isUsingMicroTask = true
+} else if (!isIE && typeof MutationObserver !== 'undefined' && (
+  isNative(MutationObserver) ||
+  MutationObserver.toString() === '[object MutationObserverConstructor]'
+)) {
+  //判断2:是否原生支持MutationObserver
+  let counter = 1
+  const observer = new MutationObserver(flushCallbacks)
+  const textNode = document.createTextNode(String(counter))
+  observer.observe(textNode, {
+    characterData: true
+  })
+  timerFunc = () => {
+    counter = (counter + 1) % 2
+    textNode.data = String(counter)
+  }
+  isUsingMicroTask = true
+} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
+  //判断3:是否原生支持setImmediate
+  timerFunc = () => {
+    setImmediate(flushCallbacks)
+  }
+} else {
+  //判断4:上面都不行,直接用setTimeout
+  timerFunc = () => {
+    setTimeout(flushCallbacks, 0)
+  }
+}
+
+function flushCallbacks () {
+  pending = false
+  const copies = callbacks.slice(0)
+  callbacks.length = 0
+  for (let i = 0; i < copies.length; i++) {
+    copies[i]()
+  }
+}
+
+nextTick(()=>{
+  console.log("nextTick callback")
+})
+nextTick().then(()=>{
+  console.log("nextTick Promise")
+})
+
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Last Updated: 3/16/2022, 6:38:11 PM
+ + + diff --git a/assets/css/0.styles.17bdf99a.css b/assets/css/0.styles.17bdf99a.css new file mode 100644 index 0000000..fe615f8 --- /dev/null +++ b/assets/css/0.styles.17bdf99a.css @@ -0,0 +1,10 @@ +.medium-zoom-overlay{z-index:100}.medium-zoom-overlay~img{z-index:101}html{scroll-behavior:smooth}.back-to-ceiling[data-v-c6073ba8]{background-color:#fff;background-color:var(--background-color);box-shadow:0 1px 6px 0 rgba(0,0,0,.2);box-shadow:var(--box-shadow);position:fixed;display:inline-block;text-align:center;cursor:pointer}.back-to-ceiling[data-v-c6073ba8]::hover{background:#d5dbe7}.back-to-ceiling .icon[data-v-c6073ba8]{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;width:26px;height:26px;fill:#3eaf7c}.fade-enter-active[data-v-c6073ba8],.fade-leave-active[data-v-c6073ba8]{transition:all .5s}.fade-enter[data-v-c6073ba8],.fade-leave-to[data-v-c6073ba8]{opacity:0;transform:translateY(120px)}.pagation[data-v-094d08e4]{font-weight:700;text-align:center;color:#888;color:var(--text-color);margin:20px auto 0;background:#f2f2f2;background:var(--background-color)}.pagation .pagation-list[data-v-094d08e4]{font-size:0;line-height:50px;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pagation .pagation-list span[data-v-094d08e4]{font-size:14px}.pagation .pagation-list span.jump[data-v-094d08e4],.pagation .pagation-list span.jumpinp input[data-v-094d08e4]{box-shadow:var(--box-shadow);border:1px solid var(--border-color)!important;border:1px solid #ccc}.pagation .pagation-list span.jump[data-v-094d08e4]{padding:5px 8px;border-radius:4px;cursor:pointer;margin-left:5px}.pagation .pagation-list span.jumpinp input[data-v-094d08e4]{width:55px;height:26px;background-color:var(--background-color);font-size:13px;border-radius:4px;text-align:center;outline:none}.pagation .pagation-list span.bgprimary[data-v-094d08e4]{cursor:default;color:#fff;background:#3eaf7c;border-color:#3eaf7c}.pagation .pagation-list span.ellipsis[data-v-094d08e4]{padding:0 8px}.pagation .pagation-list span.jumppoint[data-v-094d08e4]{margin:0 10px 0 30px}.valine-wrapper #valine.v .vbtn{color:#2c3e50;color:var(--text-color);border:1px solid #eaecef;border-color:var(--border-color)}.valine-wrapper #valine.v .vbtn:hover{color:#3eaf7c;border-color:#3eaf7c}.valine-wrapper #valine.v .vwrap{background:rgba(27,31,35,.05);background:var(--code-color);border:1px solid #eaecef;border-color:var(--border-color)}.valine-wrapper #valine.v .vwrap .vheader .vinput{border-bottom:1px dashed var(--border-color)}.valine-wrapper #valine.v .vwrap .vheader .vinput:focus{border-bottom-color:#3eaf7c}.valine-wrapper #valine.v .vwrap .vheader .vinput:-internal-autofill-selected{background-color:var(--code-color)!important}.valine-wrapper #valine.v .vinfo{padding-left:.6rem}.valine-wrapper #valine.v .vcard .vquote{margin-left:0;border-left:none}.valine-wrapper #valine.v .vcard .vimg{width:2.8rem;height:2.8rem;border-radius:.25rem;border:none}.valine-wrapper #valine.v .vcard .vhead .vnick{color:#3eaf7c}.valine-wrapper #valine.v .vcard .vhead .vnick:before{background:#3eaf7c}.valine-wrapper #valine.v .vh{border-bottom:none}.valine-wrapper #valine.v .vh .vhead .vsys{color:#3eaf7c;color:var(--text-color);background:rgba(27,31,35,.05);background:var(--code-color)}.valine-wrapper #valine.v .vh .vmeta{margin-bottom:1rem}.valine-wrapper #valine.v .vh .vmeta .vat{margin-right:.3rem;background:rgba(27,31,35,.05);background:var(--code-color);border-radius:.25rem;padding:0 .4rem;color:var(--text-color);border:1px solid #eaecef;border-color:var(--border-color)}.valine-wrapper #valine.v .vh .vmeta .vat:hover{color:#3eaf7c;border-color:#3eaf7c}.valine-wrapper #valine.v .vh .vcontent{background:rgba(27,31,35,.05);background:var(--code-color);border-radius:.25rem;margin:0 .3rem;padding:.1rem .6rem .05rem}.valine-wrapper #valine.v .vh .vcontent p .at{color:#3eaf7c}.valine-wrapper #valine.v .vh .vcontent.expand:before{z-index:1;background:linear-gradient(180deg,hsla(0,0%,100%,0),#fff);background:linear-gradient(180deg,hsla(0,0%,100%,0),var(--background-color))}.valine-wrapper #valine.v .vh .vcontent.expand:after{color:#3eaf7c;color:var(--text-color);background:#fff;background:var(--background-color)}.valine-wrapper #valine.v .info{padding-right:.6rem}.valine-wrapper #valine.v .vbtn,.valine-wrapper #valine.v code,.valine-wrapper #valine.v pre{background:var(--background-color);color:var(--text-color)}.valine-wrapper #valine.v a{color:#3eaf7c}.valine-wrapper #valine.v a:before{background:#3eaf7c} + +/*! + * vssue - A vue-powered issue-based comment plugin + * + * @version v1.4.8 + * @link https://vssue.js.org + * @license MIT + * @copyright 2018-2021 meteorlxy + */.vssue{color:#2c3e50}@media screen and (max-width:576px){.vssue .vssue-new-comment .vssue-new-comment-body{margin-left:60px}}@media screen and (min-width:577px){.vssue .vssue-new-comment .vssue-new-comment-body{margin-left:70px}}@media screen and (max-width:576px){.vssue .vssue-new-comment .vssue-new-comment-footer{text-align:center}.vssue .vssue-new-comment .vssue-new-comment-footer .vssue-new-comment-operations{margin-top:10px}}@media screen and (min-width:577px){.vssue .vssue-new-comment .vssue-new-comment-footer{margin-left:70px;text-align:right}.vssue .vssue-new-comment .vssue-new-comment-footer .vssue-current-user{float:left}}@media screen and (max-width:576px){.vssue .vssue-comments .vssue-comment .vssue-comment-body{margin-left:60px}}@media screen and (min-width:577px){.vssue .vssue-comments .vssue-comment .vssue-comment-body{margin-left:70px}}@media screen and (max-width:576px){.vssue .vssue-pagination{flex-direction:column;justify-content:center;text-align:center}}@media screen and (max-width:576px){.vssue .vssue-pagination .vssue-pagination-page{margin-top:10px}}@media screen and (min-width:577px){.vssue .vssue-pagination .vssue-pagination-page{text-align:right}}.markdown-body .tab-size[data-tab-size="1"]{-o-tab-size:1}.markdown-body .tab-size[data-tab-size="2"]{-o-tab-size:2}.markdown-body .tab-size[data-tab-size="3"]{-o-tab-size:3}.markdown-body .tab-size[data-tab-size="4"]{-o-tab-size:4}.markdown-body .tab-size[data-tab-size="5"]{-o-tab-size:5}.markdown-body .tab-size[data-tab-size="6"]{-o-tab-size:6}.markdown-body .tab-size[data-tab-size="7"]{-o-tab-size:7}.markdown-body .tab-size[data-tab-size="8"]{-o-tab-size:8}.markdown-body .tab-size[data-tab-size="9"]{-o-tab-size:9}.markdown-body .tab-size[data-tab-size="10"]{-o-tab-size:10}.markdown-body .tab-size[data-tab-size="11"]{-o-tab-size:11}.markdown-body .tab-size[data-tab-size="12"]{-o-tab-size:12}@font-face{font-family:octicons-link;src:url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==) format("woff")}.markdown-body .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.markdown-body .anchor{float:left;line-height:1;margin-left:-20px;padding-right:4px}.markdown-body .anchor:focus{outline:none}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:#1b1f23;vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#24292e;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:16px;line-height:1.5;word-wrap:break-word}.markdown-body .pl-c{color:#6a737d}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:#005cc5}.markdown-body .pl-e,.markdown-body .pl-en{color:#6f42c1}.markdown-body .pl-s .pl-s1,.markdown-body .pl-smi{color:#24292e}.markdown-body .pl-ent{color:#22863a}.markdown-body .pl-k{color:#d73a49}.markdown-body .pl-pds,.markdown-body .pl-s,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sra,.markdown-body .pl-sr .pl-sre{color:#032f62}.markdown-body .pl-smw,.markdown-body .pl-v{color:#e36209}.markdown-body .pl-bu{color:#b31d28}.markdown-body .pl-ii{background-color:#b31d28;color:#fafbfc}.markdown-body .pl-c2{background-color:#d73a49;color:#fafbfc}.markdown-body .pl-c2:before{content:"^M"}.markdown-body .pl-sr .pl-cce{color:#22863a;font-weight:700}.markdown-body .pl-ml{color:#735c0f}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{color:#005cc5;font-weight:700}.markdown-body .pl-mi{color:#24292e;font-style:italic}.markdown-body .pl-mb{color:#24292e;font-weight:700}.markdown-body .pl-md{background-color:#ffeef0;color:#b31d28}.markdown-body .pl-mi1{background-color:#f0fff4;color:#22863a}.markdown-body .pl-mc{background-color:#ffebda;color:#e36209}.markdown-body .pl-mi2{background-color:#005cc5;color:#f6f8fa}.markdown-body .pl-mdr{color:#6f42c1;font-weight:700}.markdown-body .pl-ba{color:#586069}.markdown-body .pl-sg{color:#959da5}.markdown-body .pl-corl{color:#032f62;text-decoration:underline}.markdown-body details{display:block}.markdown-body summary{display:list-item}.markdown-body a{background-color:transparent}.markdown-body a:active,.markdown-body a:hover{outline-width:0}.markdown-body strong{font-weight:inherit;font-weight:bolder}.markdown-body h1{margin:.67em 0}.markdown-body img{border-style:none}.markdown-body code,.markdown-body kbd,.markdown-body pre{font-family:monospace,monospace;font-size:1em}.markdown-body hr{box-sizing:content-box;overflow:visible}.markdown-body input{font:inherit;margin:0;overflow:visible}.markdown-body [type=checkbox]{box-sizing:border-box;padding:0}.markdown-body *{box-sizing:border-box}.markdown-body input{font-family:inherit;font-size:inherit;line-height:inherit}.markdown-body a{color:#0366d6;text-decoration:none}.markdown-body a:hover{text-decoration:underline}.markdown-body strong{font-weight:600}.markdown-body hr{background:transparent;border-bottom:1px solid #dfe2e5;height:0;margin:15px 0;overflow:hidden}.markdown-body hr:after,.markdown-body hr:before{content:"";display:table}.markdown-body hr:after{clear:both}.markdown-body table{border-collapse:collapse;border-spacing:0}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-bottom:0;margin-top:0}.markdown-body h1{font-size:32px}.markdown-body h1,.markdown-body h2{font-weight:600}.markdown-body h2{font-size:24px}.markdown-body h3{font-size:20px}.markdown-body h3,.markdown-body h4{font-weight:600}.markdown-body h4{font-size:16px}.markdown-body h5{font-size:14px}.markdown-body h5,.markdown-body h6{font-weight:600}.markdown-body h6{font-size:12px}.markdown-body p{margin-bottom:10px;margin-top:0}.markdown-body blockquote{margin:0}.markdown-body ol,.markdown-body ul{margin-bottom:0;margin-top:0;padding-left:0}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ol ol ol,.markdown-body ol ul ol,.markdown-body ul ol ol,.markdown-body ul ul ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body code,.markdown-body pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px}.markdown-body pre{margin-bottom:0;margin-top:0}.markdown-body input::-webkit-inner-spin-button,.markdown-body input::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.markdown-body .border{border:1px solid #e1e4e8!important}.markdown-body .border-0{border:0!important}.markdown-body .border-bottom{border-bottom:1px solid #e1e4e8!important}.markdown-body .rounded-1{border-radius:3px!important}.markdown-body .bg-white{background-color:#fff!important}.markdown-body .bg-gray-light{background-color:#fafbfc!important}.markdown-body .text-gray-light{color:#6a737d!important}.markdown-body .mb-0{margin-bottom:0!important}.markdown-body .my-2{margin-bottom:8px!important;margin-top:8px!important}.markdown-body .py-0{padding-bottom:0!important;padding-top:0!important}.markdown-body .py-2{padding-bottom:8px!important;padding-top:8px!important}.markdown-body .pl-3,.markdown-body .px-3{padding-left:16px!important}.markdown-body .px-3{padding-right:16px!important}.markdown-body .f6{font-size:12px!important}.markdown-body .lh-condensed{line-height:1.25!important}.markdown-body .text-bold{font-weight:600!important}.markdown-body:after,.markdown-body:before{content:"";display:table}.markdown-body:after{clear:both}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body blockquote,.markdown-body dl,.markdown-body ol,.markdown-body p,.markdown-body pre,.markdown-body table,.markdown-body ul{margin-bottom:16px;margin-top:0}.markdown-body hr{background-color:#e1e4e8;border:0;height:.25em;margin:24px 0;padding:0}.markdown-body blockquote{border-left:.25em solid #dfe2e5;color:#6a737d;padding:0 1em}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body kbd{border:1px solid #c6cbd1;border-bottom-color:#959da5;box-shadow:inset 0 -1px 0 #959da5;font-size:11px}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{font-weight:600;line-height:1.25;margin-bottom:16px;margin-top:24px}.markdown-body h1{font-size:2em}.markdown-body h1,.markdown-body h2{border-bottom:1px solid #eaecef;padding-bottom:.3em}.markdown-body h2{font-size:1.5em}.markdown-body h3{font-size:1.25em}.markdown-body h4{font-size:1em}.markdown-body h5{font-size:.875em}.markdown-body h6{color:#6a737d;font-size:.85em}.markdown-body ol,.markdown-body ul{padding-left:2em}.markdown-body ol ol,.markdown-body ol ul,.markdown-body ul ol,.markdown-body ul ul{margin-bottom:0;margin-top:0}.markdown-body li{word-wrap:break-all}.markdown-body li>p{margin-top:16px}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{font-size:1em;font-style:italic;font-weight:600;margin-top:16px;padding:0}.markdown-body dl dd{margin-bottom:16px;padding:0 16px}.markdown-body table{display:block;overflow:auto;width:100%}.markdown-body table th{font-weight:600}.markdown-body table td,.markdown-body table th{border:1px solid #dfe2e5;padding:6px 13px}.markdown-body table tr{background-color:#fff;border-top:1px solid #c6cbd1}.markdown-body table tr:nth-child(2n){background-color:#f6f8fa}.markdown-body img{background-color:#fff;box-sizing:content-box;max-width:100%}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body code{background-color:rgba(27,31,35,.05);border-radius:3px;font-size:85%;margin:0;padding:.2em .4em}.markdown-body pre{word-wrap:normal}.markdown-body pre>code{background:transparent;border:0;font-size:100%;margin:0;padding:0;white-space:pre;word-break:normal}.markdown-body .highlight{margin-bottom:16px}.markdown-body .highlight pre{margin-bottom:0;word-break:normal}.markdown-body .highlight pre,.markdown-body pre{background-color:#f6f8fa;border-radius:3px;font-size:85%;line-height:1.45;overflow:auto;padding:16px}.markdown-body pre code{background-color:transparent;border:0;display:inline;line-height:inherit;margin:0;max-width:auto;overflow:visible;padding:0;word-wrap:normal}.markdown-body .commit-tease-sha{color:#444d56;display:inline-block;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:90%}.markdown-body .blob-wrapper{border-bottom-left-radius:3px;border-bottom-right-radius:3px;overflow-x:auto;overflow-y:hidden}.markdown-body .blob-wrapper-embedded{max-height:240px;overflow-y:auto}.markdown-body .blob-num{-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;color:rgba(27,31,35,.3);cursor:pointer;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px;line-height:20px;min-width:50px;padding-left:10px;padding-right:10px;text-align:right;user-select:none;vertical-align:top;white-space:nowrap;width:1%}.markdown-body .blob-num:hover{color:rgba(27,31,35,.6)}.markdown-body .blob-num:before{content:attr(data-line-number)}.markdown-body .blob-code{line-height:20px;padding-left:10px;padding-right:10px;position:relative;vertical-align:top}.markdown-body .blob-code-inner{color:#24292e;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px;overflow:visible;white-space:pre;word-wrap:normal}.markdown-body .pl-token.active,.markdown-body .pl-token:hover{background:#ffea7f;cursor:pointer}.markdown-body kbd{background-color:#fafbfc;border:1px solid #d1d5da;border-bottom-color:#c6cbd1;border-radius:3px;box-shadow:inset 0 -1px 0 #c6cbd1;color:#444d56;display:inline-block;font:11px SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;line-height:10px;padding:3px 5px;vertical-align:middle}.markdown-body :checked+.radio-label{border-color:#0366d6;position:relative;z-index:1}.markdown-body .tab-size[data-tab-size="1"]{-moz-tab-size:1;tab-size:1}.markdown-body .tab-size[data-tab-size="2"]{-moz-tab-size:2;tab-size:2}.markdown-body .tab-size[data-tab-size="3"]{-moz-tab-size:3;tab-size:3}.markdown-body .tab-size[data-tab-size="4"]{-moz-tab-size:4;tab-size:4}.markdown-body .tab-size[data-tab-size="5"]{-moz-tab-size:5;tab-size:5}.markdown-body .tab-size[data-tab-size="6"]{-moz-tab-size:6;tab-size:6}.markdown-body .tab-size[data-tab-size="7"]{-moz-tab-size:7;tab-size:7}.markdown-body .tab-size[data-tab-size="8"]{-moz-tab-size:8;tab-size:8}.markdown-body .tab-size[data-tab-size="9"]{-moz-tab-size:9;tab-size:9}.markdown-body .tab-size[data-tab-size="10"]{-moz-tab-size:10;tab-size:10}.markdown-body .tab-size[data-tab-size="11"]{-moz-tab-size:11;tab-size:11}.markdown-body .tab-size[data-tab-size="12"]{-moz-tab-size:12;tab-size:12}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item+.task-list-item{margin-top:3px}.markdown-body .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}.markdown-body hr{border-bottom-color:#eee}.markdown-body .pl-0{padding-left:0!important}.markdown-body .pl-1{padding-left:4px!important}.markdown-body .pl-2{padding-left:8px!important}.markdown-body .pl-3{padding-left:16px!important}.markdown-body .pl-4{padding-left:24px!important}.markdown-body .pl-5{padding-left:32px!important}.markdown-body .pl-6{padding-left:40px!important}.markdown-body .pl-7{padding-left:48px!important}.markdown-body .pl-8{padding-left:64px!important}.markdown-body .pl-9{padding-left:80px!important}.markdown-body .pl-10{padding-left:96px!important}.markdown-body .pl-11{padding-left:112px!important}.markdown-body .pl-12{padding-left:128px!important}.clearfix:after,.vssue .vssue-new-comment .vssue-new-comment-footer:after{display:block;clear:both;content:""}.vssue{width:100%;color:#242424;font-size:16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;padding:10px}.vssue .vssue-button{outline:none;cursor:pointer;padding:10px 20px;font-size:1.05;font-weight:700;color:#3eaf7c;background-color:transparent;border:2px solid #3eaf7c;border-radius:10px}.vssue .vssue-button:disabled{cursor:not-allowed;color:#eaecef;border-color:#eaecef}.vssue .vssue-button:disabled .vssue-icon{fill:#eaecef}.vssue .vssue-button:not(:disabled).vssue-button-default{color:#a3aab1;border-color:#a3aab1}.vssue .vssue-button:not(:disabled).vssue-button-primary{color:#3eaf7c;border-color:#3eaf7c}.vssue .vssue-icon{width:1em;height:1em;vertical-align:-.15em;fill:#3eaf7c;overflow:hidden}.vssue .vssue-icon-loading{-webkit-animation:vssue-keyframe-rotation 1s linear infinite;animation:vssue-keyframe-rotation 1s linear infinite}@-webkit-keyframes vssue-keyframe-rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes vssue-keyframe-rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.vssue .fade-appear-active,.vssue .fade-enter-active{transition:all .3s ease}.vssue .fade-leave-active{transition:all .3s cubic-bezier(1,.5,.8,1)}.vssue .fade-appear,.vssue .fade-enter,.vssue .fade-leave-to{opacity:0}.vssue .vssue-notice{position:relative;z-index:100;transform:translateY(-11px)}.vssue .vssue-notice .vssue-alert{position:absolute;z-index:101;cursor:pointer;top:0;padding:10px 20px;width:100%;color:#3eaf7c;border:2px solid #c3ead8;border-radius:5px;background-color:#f5fbf8}.vssue .vssue-notice .vssue-progress{position:absolute;top:0;left:0;height:2px;background-color:#3eaf7c}.vssue .vssue-status{text-align:center;padding-top:20px;padding-bottom:10px;color:#3eaf7c}.vssue .vssue-status .vssue-icon{font-size:1.4em}.vssue .vssue-status .vssue-status-info{margin-top:10px;margin-bottom:10px}.vssue .vssue-header{padding-bottom:10px;border-bottom:1px solid #eaecef;margin-bottom:10px;overflow:hidden}.vssue .vssue-header .vssue-header-powered-by{float:right}.vssue .vssue-new-comment{border-bottom:1px solid #eaecef;margin-top:10px;margin-bottom:10px}.vssue .vssue-new-comment .vssue-comment-avatar{float:left;width:50px;height:50px}.vssue .vssue-new-comment .vssue-comment-avatar img{width:50px;height:50px}.vssue .vssue-new-comment .vssue-comment-avatar .vssue-icon{cursor:pointer;padding:5px;font-size:50px;fill:#757f8a}.vssue .vssue-new-comment .vssue-new-comment-body{position:relative}@media screen and (max-width:719px){.vssue .vssue-new-comment .vssue-new-comment-body{margin-left:60px}}@media screen and (min-width:720px){.vssue .vssue-new-comment .vssue-new-comment-body{margin-left:70px}}.vssue .vssue-new-comment .vssue-new-comment-body .vssue-new-comment-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vssue .vssue-new-comment .vssue-new-comment-footer{margin-top:10px;margin-bottom:10px}.vssue .vssue-new-comment .vssue-new-comment-footer .vssue-current-user{color:#a3aab1}.vssue .vssue-new-comment .vssue-new-comment-footer .vssue-current-user .vssue-logout{cursor:pointer;text-decoration:underline;color:#a3aab1;font-weight:400}@media screen and (max-width:719px){.vssue .vssue-new-comment .vssue-new-comment-footer{text-align:center}.vssue .vssue-new-comment .vssue-new-comment-footer .vssue-new-comment-operations{margin-top:10px}}@media screen and (min-width:720px){.vssue .vssue-new-comment .vssue-new-comment-footer{margin-left:70px;text-align:right}.vssue .vssue-new-comment .vssue-new-comment-footer .vssue-current-user{float:left}}.vssue .vssue-new-comment .vssue-new-comment-input{resize:none;outline:none;width:100%;padding:15px;font-size:16px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;background-color:#f5fbf8;border:1px solid #eaecef;border-radius:5px}.vssue .vssue-new-comment .vssue-new-comment-input:disabled{cursor:not-allowed;background-color:#f0f2f4}.vssue .vssue-new-comment .vssue-new-comment-input:focus{background-color:#fff;border-color:#9adbbe;box-shadow:0 0 1px 1px #9adbbe}.vssue .vssue-new-comment .vssue-new-comment-input::-moz-placeholder{color:#a3aab1}.vssue .vssue-new-comment .vssue-new-comment-input:-ms-input-placeholder{color:#a3aab1}.vssue .vssue-new-comment .vssue-new-comment-input::placeholder{color:#a3aab1}.vssue .vssue-comments .vssue-comment{margin:15px 0}.vssue .vssue-comments .vssue-comment.vssue-comment-edit-mode .vssue-comment-main{border-color:#9adbbe;box-shadow:0 0 1px 1px #9adbbe}.vssue .vssue-comments .vssue-comment.vssue-comment-disabled{pointer-events:none}.vssue .vssue-comments .vssue-comment.vssue-comment-disabled .vssue-comment-body{background-color:#f9f9fa}.vssue .vssue-comments .vssue-comment .vssue-comment-avatar{float:left;width:50px;height:50px}.vssue .vssue-comments .vssue-comment .vssue-comment-avatar img{width:50px;height:50px}@media screen and (max-width:719px){.vssue .vssue-comments .vssue-comment .vssue-comment-body{margin-left:60px}}@media screen and (min-width:720px){.vssue .vssue-comments .vssue-comment .vssue-comment-body{margin-left:70px}}.vssue .vssue-comments .vssue-comment .vssue-comment-header{padding:10px 15px;overflow:hidden;border-top-left-radius:5px;border-top-right-radius:5px;border:1px solid #eaecef;border-bottom:none}.vssue .vssue-comments .vssue-comment .vssue-comment-header .vssue-comment-created-at{float:right;cursor:default;color:#a3aab1}.vssue .vssue-comments .vssue-comment .vssue-comment-main{padding:15px;border:1px solid #eaecef}.vssue .vssue-comments .vssue-comment .vssue-comment-main .vssue-edit-comment-input{resize:none;outline:none;border:none;width:100%;background:transparent}.vssue .vssue-comments .vssue-comment .vssue-comment-footer{padding:10px 15px;overflow:hidden;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border:1px solid #eaecef;border-top:none}.vssue .vssue-comments .vssue-comment .vssue-comment-footer .vssue-comment-hint{cursor:default;color:#a3aab1}.vssue .vssue-comments .vssue-comment .vssue-comment-footer .vssue-comment-reactions .vssue-comment-reaction{cursor:pointer;display:inline-block;margin-right:8px;color:#3eaf7c}.vssue .vssue-comments .vssue-comment .vssue-comment-footer .vssue-comment-operations{float:right;color:#3eaf7c}.vssue .vssue-comments .vssue-comment .vssue-comment-footer .vssue-comment-operations .vssue-comment-operation{cursor:pointer;margin-left:8px}.vssue .vssue-comments .vssue-comment .vssue-comment-footer .vssue-comment-operations .vssue-comment-operation.vssue-comment-operation-muted{color:#a3aab1}.vssue .vssue-comments .vssue-comment .vssue-comment-footer .vssue-comment-operations .vssue-comment-operation.vssue-comment-operation-muted .vssue-icon{fill:#a3aab1}.vssue .vssue-pagination{cursor:default;display:flex;padding:5px;color:#a3aab1}@media screen and (max-width:719px){.vssue .vssue-pagination{flex-direction:column;justify-content:center;text-align:center}}.vssue .vssue-pagination .vssue-pagination-loading,.vssue .vssue-pagination .vssue-pagination-page,.vssue .vssue-pagination .vssue-pagination-per-page{flex:1}@media screen and (max-width:719px){.vssue .vssue-pagination .vssue-pagination-page{margin-top:10px}}@media screen and (min-width:720px){.vssue .vssue-pagination .vssue-pagination-page{text-align:right}}.vssue .vssue-pagination .vssue-pagination-select{outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid #9adbbe;padding-left:.2rem;padding-right:1rem;background-color:transparent;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg class='icon' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cstyle/%3E%3C/defs%3E%3Cpath d='M676.395 432.896a21.333 21.333 0 0 0-30.166 0L511.061 568.021 377.728 434.645a21.333 21.333 0 0 0-30.165 30.166l148.394 148.48a21.419 21.419 0 0 0 30.208 0l150.23-150.187a21.333 21.333 0 0 0 0-30.208'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:100%}.vssue .vssue-pagination .vssue-pagination-select:disabled{cursor:not-allowed}.vssue .vssue-pagination .vssue-pagination-select:focus{background-color:#fff;box-shadow:0 0 .2px .2px #9adbbe}.vssue .vssue-pagination .vssue-pagination-link{display:inline-block;min-width:1em;text-align:center}.vssue .vssue-pagination .vssue-pagination-link.disabled{pointer-events:none}.vssue .vssue-pagination .vssue-pagination-link:not(.disabled){color:#3eaf7c;font-weight:500;cursor:pointer}.vssue,.vssue *{box-sizing:border-box}.vssue :not(.vssue-comment-content) a{cursor:pointer;font-weight:500;color:#3eaf7c;text-decoration:none}.vssue :not(.vssue-comment-content) hr{display:block;height:1px;border:0;border-top:1px solid #eaecef;margin:1.2rem 0;padding:0}.vssue-wrapper.vssue{color:#2c3e50;color:var(--text-color)}.vssue-wrapper.vssue .vssue-new-comment{border-bottom:1px solid #eaecef;border-bottom:1px solid var(--border-color)}.vssue-wrapper.vssue .vssue-new-comment .vssue-new-comment-input:disabled{background-color:#fff;background-color:var(--background-color);border:1px solid #eaecef;border:1px solid var(--border-color)}.vssue-wrapper.vssue .vssue-new-comment .vssue-new-comment-footer .vssue-current-user{color:#2c3e50;color:var(--text-color)}.vssue-wrapper.vssue .vssue-header{border-bottom:1px solid #eaecef;border-bottom:1px solid var(--border-color)}.vssue-wrapper.vssue .vssue-comments .vssue-pagination .vssue-pagination-per-page .vssue-pagination-select{color:var(--text-color)}.vssue-wrapper.vssue .vssue-comments .vssue-comment .vssue-comment-body .vssue-comment-footer,.vssue-wrapper.vssue .vssue-comments .vssue-comment .vssue-comment-body .vssue-comment-header,.vssue-wrapper.vssue .vssue-comments .vssue-comment .vssue-comment-body .vssue-comment-main{border:none}.vssue-wrapper.vssue .vssue-comments .vssue-comment .vssue-comment-body .vssue-comment-footer,.vssue-wrapper.vssue .vssue-comments .vssue-comment .vssue-comment-body .vssue-comment-main{background:var(--code-color)}.vssue-wrapper.vssue .vssue-comments .vssue-comment .vssue-comment-body .vssue-comment-footer{border-top:2px solid var(--background-color)}.vssue-wrapper.vssue .vssue-comments .vssue-comment .vssue-comment-avatar img{width:2.8rem;height:2.8rem;border-radius:.25rem}.vssue-wrapper.vssue .markdown-body{color:var(--text-color)}#nprogress{pointer-events:none}#nprogress .bar{background:#3eaf7c;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border-color:#3eaf7c transparent transparent #3eaf7c;border-style:solid;border-width:2px;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.icon.outbound{color:#aaa;display:inline-block;vertical-align:middle;position:relative;top:-1px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.home{padding:3.6rem 2rem 0;max-width:960px;margin:0 auto}.home .hero{text-align:center}.home .hero h1{display:block;font-size:2.5rem;color:var(--text-color)}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.8rem auto}.home .hero .description{font-size:1.6rem;line-height:1.3;color:var(--text-color)}.home .hero .action-button{display:inline-block;font-size:1.2rem;color:#fff;background-color:#3eaf7c;padding:.2rem 1.2rem;border-radius:.25rem;transition:background-color .1s ease;box-sizing:border-box}.home .hero .action-button:hover{background-color:#4abf8a}.home .features{border-top:1px solid var(--border-color);padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%;transition:all .5s;color:var(--text-color)}.home .feature h2{font-size:1.6rem;font-weight:500;border-bottom:none;padding-bottom:0}.home .feature:hover{transform:scale(1.05)}@media (max-width:719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width:419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.badge[data-v-08862138]{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:.25rem;padding:0 6px;color:#fff}.badge.green[data-v-08862138],.badge.tip[data-v-08862138],.badge[data-v-08862138]{background-color:#42b983}.badge.error[data-v-08862138]{background-color:#da5961}.badge.warn[data-v-08862138],.badge.warning[data-v-08862138],.badge.yellow[data-v-08862138]{background-color:#e7c000}.badge+.badge[data-v-08862138]{margin-left:5px}.search-box{display:inline-block;position:relative;margin-right:1rem}.search-box .iconfont{position:absolute;top:0;bottom:0;z-index:0;left:.6rem;margin:auto}.search-box input{cursor:text;width:10rem;height:2rem;color:#5b5b5b;display:inline-block;border:1px solid var(--border-color);border-radius:.25rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;transition:all .2s ease;background:transparent;background-size:1rem}.search-box input:focus{cursor:auto;border-color:#3eaf7c}.search-box .suggestions{background:var(--background-color);width:20rem;position:absolute;top:1.5rem;border:1px solid #cfd4db;border-radius:6px;padding:.4rem;list-style-type:none}.search-box .suggestions.align-right{right:0}.search-box .suggestion{line-height:1.4;padding:.4rem .6rem;border-radius:4px;cursor:pointer}.search-box .suggestion a{white-space:normal;color:var(--text-color)}.search-box .suggestion a .page-title{font-weight:600}.search-box .suggestion a .header{font-size:.9em;margin-left:.25em}.search-box .suggestion.focused{background-color:var(--border-color)}.search-box .suggestion.focused a{color:#3eaf7c}@media (max-width:959px){.search-box input{cursor:pointer;width:0;border-color:transparent;position:relative}.search-box input:focus{cursor:text;left:0;width:10rem}}@media (-ms-high-contrast:none){.search-box input{height:2rem}}@media (max-width:959px) and (min-width:719px){.search-box{margin-right:0}.search-box .suggestions{left:0}}@media (max-width:719px){.search-box{margin-right:0}.search-box .suggestions{right:0}}@media (max-width:419px){.search-box .suggestions{width:calc(100vw - 4rem)}.search-box input:focus{width:8rem}}.sidebar-button{cursor:pointer;display:none;width:1.25rem;height:1.25rem;position:absolute;padding:.6rem;top:.6rem;left:1rem}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media (max-width:719px){.sidebar-button{display:block}}.dropdown-enter,.dropdown-leave-to{height:0!important}.dropdown-wrapper{cursor:pointer}.dropdown-wrapper .dropdown-title{display:block}.dropdown-wrapper .dropdown-title:hover{border-color:transparent}.dropdown-wrapper .dropdown-title .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.dropdown-wrapper .nav-dropdown .dropdown-item{color:inherit;line-height:1.7rem}.dropdown-wrapper .nav-dropdown .dropdown-item h4{margin:.45rem 0 0;border-top:1px solid var(--border-color);padding:.45rem 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper{padding:0;list-style:none}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper .dropdown-subitem{font-size:.9em}.dropdown-wrapper .nav-dropdown .dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid #3eaf7c;border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.dropdown-wrapper .nav-dropdown .dropdown-item:first-child h4{margin-top:0;padding-top:0;border-top:0}@media (max-width:719px){.dropdown-wrapper.open .dropdown-title{margin-bottom:.5rem}.dropdown-wrapper .nav-dropdown{transition:height .1s ease-out;overflow:hidden}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top:0;margin-top:0;padding-top:0}.dropdown-wrapper .nav-dropdown .dropdown-item>a,.dropdown-wrapper .nav-dropdown .dropdown-item h4{font-size:15px;line-height:2rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width:719px){.dropdown-wrapper{height:1.8rem}.dropdown-wrapper:hover .nav-dropdown{display:block!important}.dropdown-wrapper .dropdown-title .arrow{border-left:4px solid transparent;border-right:4px solid transparent;border-top:6px solid var(--text-color-sub);border-bottom:0}.dropdown-wrapper .nav-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:var(--background-color);padding:.6rem 0;box-shadow:var(--box-shadow);text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.nav-links{display:inline-block}.nav-links a{line-height:1.4rem;color:var(--text-color)}.nav-links a.router-link-active,.nav-links a.router-link-active .iconfont,.nav-links a:hover,.nav-links a:hover .iconfont{color:#3eaf7c}.nav-links .nav-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:2rem}.nav-links .nav-item:first-child{margin-left:0}.nav-links .repo-link{margin-left:1.5rem}@media (max-width:719px){.nav-links .nav-item,.nav-links .repo-link{margin-left:0}}@media (min-width:719px){.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{margin-bottom:-2px}}.mode-options{background-color:var(--background-color);min-width:125px;margin:0;padding:1em;box-shadow:var(--box-shadow);border-radius:.25rem}.mode-options .title{margin-top:0;margin-bottom:.6rem;font-weight:700;color:var(--text-color)}.mode-options .color-mode-options{display:flex;flex-wrap:wrap}.mode-options .color-mode-options li{flex:1;text-align:center;font-size:12px;color:var(--text-color);line-height:18px;padding:3px 6px;border-top:1px solid #666;border-bottom:1px solid #666;background-color:var(--background-color);cursor:pointer}.mode-options .color-mode-options li.dark{border-radius:.25rem 0 0 .25rem;border-left:1px solid #666}.mode-options .color-mode-options li.light{border-radius:0 .25rem .25rem 0;border-right:1px solid #666}.mode-options .color-mode-options li.active{background-color:#3eaf7c;color:#fff}.mode-options .color-mode-options li:not(.active){border-right:1px solid #666}.color-picker{position:relative;margin-right:1em;cursor:pointer}.color-picker .color-button{align-items:center;height:100%}.color-picker .color-button .iconfont{font-size:1.4rem;color:#3eaf7c}.color-picker .color-picker-menu{position:absolute;top:40px;left:50%;z-index:150}.color-picker .color-picker-menu ul{list-style-type:none;margin:0;padding:0}@media (max-width:719px){.color-picker{margin-right:1rem}.color-picker .color-picker-menu{left:calc(50% - 35px)}.color-picker .color-picker-menu:before{left:calc(50% + 35px)}}.navbar{padding:.7rem 1.5rem;line-height:2.2rem;box-shadow:var(--box-shadow);background:var(--background-color)}.navbar a,.navbar img,.navbar span{display:inline-block}.navbar .logo{height:2.2rem;min-width:2.2rem;margin-right:.8rem;vertical-align:top;border-radius:50%}.navbar .site-name{font-size:1.2rem;font-weight:600;color:var(--text-color);position:relative}.navbar .links{padding-left:1.5rem;box-sizing:border-box;white-space:nowrap;font-size:.9rem;position:absolute;right:1.5rem;top:.7rem;display:flex;background-color:var(--background-color)}.navbar .links .search-box{flex:0 0 auto;vertical-align:top}@media (max-width:719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .links{padding-left:.2rem}}.tags[data-v-285c9a44]{margin:30px 0}.tags span[data-v-285c9a44]{vertical-align:middle;margin:4px 4px 10px;padding:4px 8px;display:inline-block;cursor:pointer;border-radius:.25rem;background:#fff;color:#fff;line-height:13px;font-size:13px;box-shadow:var(--box-shadow);transition:all .5s}.tags span[data-v-285c9a44]:hover{transform:scale(1.04)}.tags span.active[data-v-285c9a44]{transform:scale(1.2)}.friend-link-wrapper[data-v-165dc218]{position:relative;margin:30px 0}.friend-link-wrapper .friend-link-item[data-v-165dc218]{position:relative;vertical-align:middle;margin:4px 4px 10px;padding:4px 8px 4px 20px;line-height:20px;display:inline-block;cursor:default;border-radius:.25rem;font-size:13px;box-shadow:var(--box-shadow);transition:all .5s}.friend-link-wrapper .friend-link-item .list-style[data-v-165dc218]{position:absolute;left:.4rem;top:0;bottom:0;margin:auto;display:block;width:.4rem;height:.4rem;border-radius:.1rem;background:#3eaf7c;content:""}.friend-link-wrapper .friend-link-item .popup-window-wrapper[data-v-165dc218]{display:none}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window[data-v-165dc218]{position:absolute;display:flex;background:var(--background-color);box-shadow:var(--box-shadow);border-radius:.25rem;box-sizing:border-box;padding:.8rem 1rem;width:280px}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window .logo[data-v-165dc218]{margin-right:.4rem;width:2rem;height:2rem;flex:0 0 2rem;border-radius:.25rem;overflow:hidden}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window .logo img[data-v-165dc218]{width:2rem;height:2rem}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window .info[data-v-165dc218]{flex:0 0 85%;width:85%}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window .info .title[data-v-165dc218]{display:flex;align-items:center;justify-content:space-between;height:2rem}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window .info .title h4[data-v-165dc218]{margin:.2rem 0;flex:0 0 86%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window .info .title .btn-go[data-v-165dc218]{width:1.4rem;height:1.2rem;border-radius:.25rem;font-size:12px;color:#fff;text-align:center;line-height:1.2rem;cursor:pointer;transition:all .5s}.friend-link-wrapper .friend-link-item .popup-window-wrapper .popup-window .info .title .btn-go[data-v-165dc218]:hover{transform:scale(1.1)}.fade-enter-active[data-v-165dc218],.fade-leave-active[data-v-165dc218]{transition:opacity .5s}.fade-enter[data-v-165dc218],.fade-leave-to[data-v-165dc218]{opacity:0}.iconfont[data-v-f875f3fc]{display:inline-block;line-height:1.5rem}.iconfont[data-v-f875f3fc]:not(:last-child){margin-right:1rem}.iconfont span[data-v-f875f3fc]{margin-left:.5rem}.tags .tag-item[data-v-f875f3fc]{font-family:Ubuntu,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;cursor:pointer}.tags .tag-item.active[data-v-f875f3fc],.tags .tag-item[data-v-f875f3fc]:hover{color:#3eaf7c}@media (max-width:719px){.tags[data-v-f875f3fc]{display:block;margin-left:0!important}}.abstract-item[data-v-ff2c8be0]{position:relative;margin:0 auto 20px;padding:16px 20px;width:100%;overflow:hidden;border-radius:.25rem;box-shadow:var(--box-shadow);box-sizing:border-box;transition:all .3s;background-color:var(--background-color);cursor:pointer}.abstract-item>[data-v-ff2c8be0]{pointer-events:auto}.abstract-item .reco-sticky[data-v-ff2c8be0]{position:absolute;top:0;left:0;display:inline-block;color:#3eaf7c;font-size:2.4rem}.abstract-item[data-v-ff2c8be0]:hover{box-shadow:var(--box-shadow-hover)}.abstract-item .title[data-v-ff2c8be0]{position:relative;font-size:1.28rem;line-height:46px;display:inline-block}.abstract-item .title a[data-v-ff2c8be0]{color:var(--text-color)}.abstract-item .title .reco-lock[data-v-ff2c8be0]{font-size:1.28rem;color:#3eaf7c}.abstract-item .title[data-v-ff2c8be0]:after{content:"";position:absolute;width:100%;height:2px;bottom:0;left:0;background-color:#3eaf7c;visibility:hidden;transform:scaleX(0);transition:.3s ease-in-out}.abstract-item .title:hover a[data-v-ff2c8be0]{color:#3eaf7c}.abstract-item .title[data-v-ff2c8be0]:hover:after{visibility:visible;transform:scaleX(1)}.abstract-item .tags .tag-item.active[data-v-ff2c8be0],.abstract-item .tags .tag-item[data-v-ff2c8be0]:hover{color:#3eaf7c}@media (max-width:719px){.tags[data-v-ff2c8be0]{display:block;margin-top:1rem;margin-left:0!important}}.sidebar-group{background:var(--background-color)}.sidebar-group .sidebar-group{padding-left:.5em}.sidebar-group:not(.collapsable) .sidebar-heading:not(.clickable){cursor:auto;color:var(--text-color)}.sidebar-group.is-sub-group{padding-left:0}.sidebar-group.is-sub-group>.sidebar-heading{font-size:.95em;line-height:1.4;font-weight:400;padding-left:2rem}.sidebar-group.is-sub-group>.sidebar-heading:not(.clickable){opacity:.5}.sidebar-group.is-sub-group>.sidebar-group-items{padding-left:1rem}.sidebar-group.is-sub-group>.sidebar-group-items>li>.sidebar-link{font-size:.95em;border-left:none}.sidebar-group.depth-2>.sidebar-heading{border-left:none}.sidebar-heading{position:relative;color:var(--text-color);transition:color .15s ease;cursor:pointer;font-size:1em;font-weight:500;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0}.sidebar-heading.open,.sidebar-heading:hover{color:#3eaf7c}.sidebar-heading .arrow{position:absolute;top:0;bottom:0;right:1em;margin:auto}.sidebar-heading.clickable.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-heading.clickable:hover{color:#3eaf7c}.sidebar-group-items{transition:height .1s ease-out;font-size:.95em;overflow:hidden}.abstract-wrapper[data-v-6cc0658a]{width:100%}.personal-info-wrapper .personal-img[data-v-39576ba9]{display:block;margin:2rem auto 1rem;width:6rem;height:6rem;border-radius:50%}.personal-info-wrapper .name[data-v-39576ba9]{font-size:1rem;text-align:center;color:var(--text-color)}.personal-info-wrapper .num[data-v-39576ba9]{display:flex;margin:0 auto 1rem;width:80%}.personal-info-wrapper .num>div[data-v-39576ba9]{text-align:center;flex:0 0 50%}.personal-info-wrapper .num>div[data-v-39576ba9]:first-child{border-right:1px solid #333}.personal-info-wrapper .num>div h3[data-v-39576ba9]{line-height:auto;margin:0 0 .6rem;color:var(--text-color)}.personal-info-wrapper .num>div h6[data-v-39576ba9]{line-height:auto;color:var(--text-color);margin:0}.personal-info-wrapper .social-links[data-v-39576ba9]{box-sizing:border-box;display:flex;flex-wrap:wrap;padding:10px}.personal-info-wrapper .social-links .social-item[data-v-39576ba9]{width:39px;height:36px;line-height:36px;text-align:center;list-style:none;transition:transform .3s}.personal-info-wrapper .social-links .social-item[data-v-39576ba9]:hover{transform:scale(1.08)}.personal-info-wrapper .social-links .social-item i[data-v-39576ba9]{cursor:pointer;font-size:22px}.home-blog{padding:0;margin:0 auto}.home-blog .hero{margin:3.6rem auto 0;position:relative;box-sizing:border-box;padding:0 20px;height:100vh;display:flex;align-items:center;justify-content:center}.home-blog .hero .hero-img{max-width:300px;margin:0 auto 1.5rem}.home-blog .hero h1{display:block;margin:0 auto 1.8rem;font-size:2.5rem}.home-blog .hero .description{margin:1.8rem auto;font-size:1.6rem;line-height:1.3}.home-blog .home-blog-wrapper{display:flex;align-items:flex-start;margin:20px auto 0;padding:0 20px;max-width:1126px}.home-blog .home-blog-wrapper .blog-list{flex:auto;width:0}.home-blog .home-blog-wrapper .blog-list .abstract-wrapper .abstract-item:last-child{margin-bottom:0}.home-blog .home-blog-wrapper .info-wrapper{position:sticky;top:70px;overflow:hidden;transition:all .3s;margin-left:15px;flex:0 0 300px;height:auto;box-shadow:var(--box-shadow);border-radius:.25rem;box-sizing:border-box;padding:0 15px;background:var(--background-color)}.home-blog .home-blog-wrapper .info-wrapper:hover{box-shadow:var(--box-shadow-hover)}.home-blog .home-blog-wrapper .info-wrapper h4{color:var(--text-color)}.home-blog .home-blog-wrapper .info-wrapper .category-wrapper{list-style:none;padding-left:0}.home-blog .home-blog-wrapper .info-wrapper .category-wrapper .category-item{margin-bottom:.4rem;padding:.4rem .8rem;transition:all .5s;border-radius:.25rem;box-shadow:var(--box-shadow);background-color:var(--background-color)}.home-blog .home-blog-wrapper .info-wrapper .category-wrapper .category-item:hover{transform:scale(1.04)}.home-blog .home-blog-wrapper .info-wrapper .category-wrapper .category-item:hover a{color:#3eaf7c}.home-blog .home-blog-wrapper .info-wrapper .category-wrapper .category-item a{display:flex;justify-content:space-between;align-items:center;color:var(--text-color)}.home-blog .home-blog-wrapper .info-wrapper .category-wrapper .category-item a .post-num{width:1.6rem;height:1.6rem;text-align:center;line-height:1.6rem;border-radius:.25rem;background:#eee;font-size:13px;color:#fff}@media (max-width:719px){.home-blog .hero{height:450px}.home-blog .hero img{max-height:210px;margin:2rem auto 1.2rem}.home-blog .hero h1{margin:0 auto 1.8rem;font-size:2rem}.home-blog .hero .description{font-size:1.2rem}.home-blog .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home-blog .home-blog-wrapper{display:block!important}.home-blog .home-blog-wrapper .blog-list{width:auto}.home-blog .home-blog-wrapper .info-wrapper{margin-left:0}.home-blog .home-blog-wrapper .info-wrapper .personal-info-wrapper{display:none}}@media (max-width:419px){.home-blog .hero{height:450px}.home-blog .hero img{max-height:210px;margin:2rem auto 1.2rem}.home-blog .hero h1{margin:0 auto 1.8rem;font-size:2rem}.home-blog .hero .description{font-size:1.2rem}.home-blog .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home-blog .home-blog-wrapper{display:block!important}.home-blog .home-blog-wrapper .blog-list{width:auto}.home-blog .home-blog-wrapper .info-wrapper{margin-left:0}.home-blog .home-blog-wrapper .info-wrapper .personal-info-wrapper{display:none}}.sub-sidebar-wrapper[data-v-cb1513f6]{width:12rem;padding-left:0;list-style:none;font-size:12px}.sub-sidebar-wrapper li[data-v-cb1513f6]{padding:.2rem 0;cursor:pointer;border-left:1px solid var(--border-color)}.sub-sidebar-wrapper li a[data-v-cb1513f6]{padding:.35rem 1rem .35rem 0;color:var(--text-color)}.sub-sidebar-wrapper li:hover a[data-v-cb1513f6]{color:#3eaf7c}.sub-sidebar-wrapper li.active[data-v-cb1513f6]{border-left:1px solid #3eaf7c}.sub-sidebar-wrapper li.active a[data-v-cb1513f6]{color:#3eaf7c}.sub-sidebar-wrapper li.level-1[data-v-cb1513f6]{padding-left:.4rem}.sub-sidebar-wrapper li.level-2[data-v-cb1513f6]{padding-left:.9rem}.sub-sidebar-wrapper li.level-3[data-v-cb1513f6]{padding-left:1.5rem}.page-nav,.page .comments-wrapper,.page .page-edit{max-width:860px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-nav,.page .comments-wrapper,.page .page-edit{padding:2rem}}@media (max-width:419px){.page-nav,.page .comments-wrapper,.page .page-edit{padding:1.5rem}}.page{position:relative;padding-top:5rem;padding-bottom:2rem;padding-right:14rem;display:block}.page .side-bar{position:fixed;top:8rem;bottom:5rem;right:2rem;overflow-y:scroll}.page .side-bar::-webkit-scrollbar{width:0;height:0}.page .page-title{max-width:860px;margin:0 auto;padding:1rem 2.5rem;color:var(--text-color)}.page .theme-reco-content h2{position:relative;padding-left:.8rem}.page .theme-reco-content h2:before{position:absolute;left:0;top:3.5rem;display:block;height:1.8rem;content:"";border-left:5px solid #3eaf7c}.page .page-edit{padding-top:1rem;padding-bottom:1rem;overflow:auto}.page .page-edit .edit-link{display:inline-block}.page .page-edit .edit-link a{color:#3eaf7c;margin-right:.25rem}.page .page-edit .last-updated{float:right;font-size:.9em}.page .page-edit .last-updated .prefix{font-weight:500;color:#3eaf7c}.page .page-edit .last-updated .time{font-weight:400;color:#aaa}.page-nav{padding-top:1rem;padding-bottom:0}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid var(--border-color);padding-top:1rem;overflow:auto}.page-nav .next{float:right}@media (max-width:719px){.page{padding-right:0}.page .side-bar{display:none}.page .page-title{padding:0 1rem}.page .page-edit .edit-link{margin-bottom:.5rem}.page .page-edit .last-updated{font-size:.8em;float:none;text-align:left}}.footer-wrapper[data-v-c3cf170c]{padding:1.5rem 2.5rem;border-top:1px solid var(--border-color);text-align:center;color:#5b5b5b}.footer-wrapper a[data-v-c3cf170c]{font-size:14px}.footer-wrapper>span[data-v-c3cf170c]{margin-left:1rem}.footer-wrapper>span>i[data-v-c3cf170c]{margin-right:.5rem}.footer-wrapper .cyber-security img[data-v-c3cf170c]{margin-right:.5rem;width:20px;height:20px;vertical-align:middle}.footer-wrapper .cyber-security a[data-v-c3cf170c]{vertical-align:middle}@media (max-width:719px){.footer[data-v-c3cf170c]{text-align:left!important}.footer>span[data-v-c3cf170c]{display:block;margin-left:0;line-height:2rem}}.sidebar .sidebar-sub-headers{padding-left:1.5rem;font-size:.95em}.sidebar-sub-headers a.sidebar-link{margin:0 1rem 0 .6rem}a.sidebar-link{font-size:1em;font-weight:400;display:block!important;color:var(--text-color);padding:.35rem 1rem .35rem 2.25rem;line-height:1.7;background:var(--background-color);box-sizing:border-box}a.sidebar-link:hover{color:#3eaf7c}a.sidebar-link.active{font-weight:600;color:#3eaf7c;background:var(--default-color-8);border-right:3px solid #3eaf7c}.sidebar-sub-headers a.sidebar-link{padding-top:.25rem;padding-bottom:.25rem;border-left:none}.sidebar-sub-headers a.sidebar-link.active{font-weight:500;background:transparent;color:#3eaf7c}.sidebar.sidebar::-webkit-scrollbar{width:0;height:0}.sidebar .personal-info-wrapper{display:none}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar ul.sidebar-links>li{background:#3eaf7c}.sidebar a{display:inline-block}.sidebar .nav-links{display:none;border-bottom:1px solid var(--border-color);padding:.5rem 0 .75rem}.sidebar .nav-links a{font-weight:600}.sidebar .nav-links .nav-item,.sidebar .nav-links .repo-link{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar>.sidebar-links{padding:1.5rem 0}.sidebar>.sidebar-links>li>a.sidebar-link{font-size:1em;line-height:1.7;font-weight:500}.sidebar>.sidebar-links>li:not(:first-child){margin-top:.75rem}@media (max-width:719px){.sidebar .nav-links,.sidebar .personal-info-wrapper{display:block}.sidebar .nav-links .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar>.sidebar-links{padding:1rem 0}}.password-shadow[data-v-25ba6db2]{overflow:hidden;position:relative;background:#fff;background:var(--background-color);box-sizing:border-box}.password-shadow .title[data-v-25ba6db2]{margin:8rem auto 2rem;width:100%;font-size:30px}.password-shadow .description[data-v-25ba6db2],.password-shadow .title[data-v-25ba6db2]{text-align:center;box-sizing:border-box;text-shadow:0 2px 4px rgba(0,0,0,.1);color:#242424;color:var(--text-color)}.password-shadow .description[data-v-25ba6db2]{margin:0 auto 6rem;font-size:22px;padding:0 10px}.password-shadow .inputBox[data-v-25ba6db2]{position:absolute;top:40%;left:0;right:0;margin:auto;display:block;max-width:700px;height:100px;background:#3eaf7c;border-radius:.25rem;padding-left:20px;box-sizing:border-box;opacity:.9}.password-shadow .inputBox input[data-v-25ba6db2]{width:570px;height:100%;border:none;padding:0 0 0 5px;color:#fff;background:none;outline:none;position:absolute;bottom:0;left:20px;opacity:0;font-size:50px}.password-shadow .inputBox input[data-v-25ba6db2]:focus{opacity:1}.password-shadow .inputBox input:focus~span[data-v-25ba6db2]{transform:translateY(-80px);color:#3eaf7c;font-size:30px;opacity:.8}.password-shadow .inputBox input:focus~button[data-v-25ba6db2]{opacity:1;width:100px}.password-shadow .inputBox span[data-v-25ba6db2]{width:200px;height:100%;display:block;position:absolute;line-height:100px;top:0;left:20px;color:#fff;cursor:text;transition:.5s;transform-origin:left top;font-size:30px}.password-shadow .inputBox button[data-v-25ba6db2]{overflow:hidden;width:0;height:98px;border-radius:.25rem;position:absolute;background:var(--background-color);right:1px;top:1px;border:0;padding:0;color:#3eaf7c;font-size:18px;outline:none;cursor:pointer;opacity:0;transition:.5s;z-index:1}.password-shadow .footer[data-v-25ba6db2]{position:absolute;left:0;right:0;bottom:10%;padding:2.5rem;text-align:center;color:#5b5b5b}.password-shadow .footer>span[data-v-25ba6db2]{margin-left:1rem}.password-shadow .footer>span>i[data-v-25ba6db2]{margin-right:.5rem}@media (max-width:719px){.password-shadow .inputBox[data-v-25ba6db2]{max-width:700px;height:60px;background:#3eaf7c;border-radius:.25rem;position:absolute;left:0;right:0;top:43%;margin:auto 20px;padding-left:0;box-sizing:border-box;opacity:.9}.password-shadow .inputBox input[data-v-25ba6db2]{width:60%;height:100%;border:none;padding:0 0 0 5px;color:#fff;background:none;outline:none;position:absolute;bottom:0;opacity:0;font-size:30px}.password-shadow .inputBox input[data-v-25ba6db2]:focus{opacity:1}.password-shadow .inputBox input:focus~span[data-v-25ba6db2]{transform:translateY(-60px);color:#3eaf7c;font-size:20px;opacity:.8}.password-shadow .inputBox input:focus~button[data-v-25ba6db2]{opacity:1;width:60px}.password-shadow .inputBox span[data-v-25ba6db2]{width:200px;height:100%;display:block;position:absolute;line-height:60px;top:0;left:20px;color:#fff;cursor:text;transition:.5s;transform-origin:left top;font-size:20px}.password-shadow .inputBox button[data-v-25ba6db2]{width:0;height:58px;border-radius:.25rem;position:absolute;right:1px;top:1px;border:0;padding:0;background:#fff;color:#3eaf7c;font-size:18px;outline:none;cursor:pointer;opacity:0;transition:.5s;z-index:1}.password-shadow .footer[data-v-25ba6db2]{margin-left:0}}@media (max-width:959px){.password-shadow .footer[data-v-25ba6db2]{margin-left:0}}.theme-container .loading-wrapper[data-v-130b300a]{position:absolute;z-index:22;top:0;bottom:0;left:0;right:0;margin:auto}.theme-container .password-wrapper-out[data-v-130b300a]{position:absolute;z-index:21;top:0;bottom:0;left:0;right:0;margin:auto}.theme-container .password-wrapper-in[data-v-130b300a]{position:absolute;z-index:8;top:0;bottom:0;left:0;right:0}.theme-container .hide[data-v-130b300a]{height:100vh;overflow:hidden;opacity:0}.fade-enter-active[data-v-130b300a],.fade-leave-active[data-v-130b300a]{transition:opacity .5s ease-in-out .5s}.fade-enter[data-v-130b300a],.fade-leave-to[data-v-130b300a]{opacity:0}@font-face{font-family:iconfont;src:url(data:font/woff2;base64,d09GMgABAAAAACcIAAsAAAAARPAAACa6AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACKegrvONktATYCJAOBZAt0AAQgBYRnB4QOG604RaTdtJfiZP8fDugB82cnpUAl0ZGsRjJLjaLz7uhxFXN2ZOvr79/nQ9vQlsfQdlhwYIL57VuYrybm6PdDKXkefu3beTNfbMX8ryOe8ERJpE2URqJUIiWQCFnTRXR4fm7/5967DEZvrBmMGIwesaakR46UsRESreh/UiIiRoPPeJiA2YCJXzGywagXC4A2P3+HXwABBLn77T7wUDKLIGkLrEAC4J+qadm9EOi2d1N1A5JlWJAsW1rM2XwAMOA9HezyISTxp7vy66n8eqYFhgOJzbTIA4FXKq9s6fT0aMUvAyuANKXtRMvW23mZaqU6zi0Tw5Q23vptr7vAApSA5AiRvP//dJat5CPu7sIHCv4At4A9V+WMtDQaL0iLWoXsQ1kHkjdgb8iHWIUAPIvWoeQNSEE7BFzmpSKsrijqABVlnz66ibgowOCca6phdf0xpuk5fkypdQ1CeEMEI4o7artvj4KeMw9UD/WTDIByVVBXARw12EctxActVyWWAoB7rNQgDCg6ZS3apTaYF4Im1Wt4DABv/He+/AK+BQdUmjWwb9KLlzoTGHkJfViztVn9EYyyS4GWKzRRYyhYVfWBPLy8B0hoDtV6uOc6qvQAHlNCawWBR8LEISQmISXjJ5SWgVGuyUrMMDeFLGY5917+07iZev163s//v0vf7P/DZQ0EjYiCzWLr7rzJKWh2p0XT9LZbLx6LkcwgVz7a+mQmZsVKd3uFmv8oD9gwsGTRvOu2TFswal/LulPjZnTc0HXpwpS2ngm3nLlmU9O5STfVRuxadWTNnKFjy1bsGFMpZm07dGJPw4E+pQXgwAOo3hljbxHIATYIDAwIAiwRNLBIMMA8wQLXCQ7YInhgmhCBBUISjBJgn1CBFqEB64QOnBKGjBRmAjBD2ECHcIAbRAh0iRi4JBLggrjLWIWlALSJN9AjMmCCyCWZhf1ARgorQJYPhwKwSTRAk2iBc2IAJokRuElygZpMBkaIBdglxcAqKQGOSBOwRqYDc2QGMCRzgWOyEVgmB4AVcgjYIZeBMfIPUPENkvlhLihmIWwCxTaEXwNwyPd5wAk/3wB7/EoHGvybDRzwf/gQ+uC2u4RXgK8ATD4Cc8/tqvLWqNRcEfSiRslNlbaG2rG3VTqm3H0asCZNBZZoRLEMEXrBmkK8d6rdIjZUAAVSQRlc1jsjbnPaE6rIS+p5G6dJTVqVOXsQUpvy92EjrBrbTZnFUcovjVlU07yvVkUvyILIWjbGTjE15IcmTH7iWTjjLN7XRyfYxvk1j7tt3nIJ34N8WKtypUr2W/+WyR96N+o6rjsVXdHtrRvHa+xjkx0FhQujRkY5Z6PlBdrWHLZVCZQ23j66QcCb1yVGymsWkDq3fWU/TfOECSL9/ppFOX2lI5tI5Y48a11IOFRYsh0rWPGSKiyDlFmV1qyKHjwoJt1gbVW/y9RJxarRKmJ5yXC4pM25bVW2BkhF5oB4nhUEkCqiZhLN9f7M8PtTM+hv6d6Iz5jrkp8N1PdPUEj3/do847+y8MIVhNhzlzquuUeG9vwMANn7S9O09/L885cxtl682n0zeHR0/2/wOPN9GgSW5xHXTYl0N5LyOQ0bp3axe2AHuY93Ww/hztEH7xtIQyl87DP6AO1iZVLBu3eIzIY7Bx30J1YGBPzVLnj7rJKaqtPQe7tTInuCU4n7W/shcwGmyRq21gFpk9wpADCkk/FNdRJSf+CyoiTcfFHH7szA7XT2JsY0CyENXt3pLe/oNABE4hK2bl8NtpGpa2eBAPmFqzA3scKWxsh4il64w25tAVCv/fGRv2CAITYMUA8Hd7FrU2AHmb4uoMPNWbiTztz4C2IbdBOLcWSyZsbbxL2MulB9ax/ttu6D4ydHH2rbmoW1/ThXPiPjsUJcoAAl9UwQueu/k9hI3Olb6Zh7zH3t1gc2kTQu1/NBNYVlJDydNDe7VztjevmxWz1e73L3Yr+uk642Z4rh5NPyS5o5JfdrotpBR5QKiZLR70dmbZpRbcj+9oOdlnheGWzNzPTB9+wBfWjdJ/fqEXOgH8Tw4iAV2NORTjjGyQakvBdYzX2EAbFxKWYJCJiDxVlqLSmoUn0n4QgZW7pDFlIHMYNx8AnGesYwcgoUtDb0ApOBwzubSeU2TuR1XbZljvHCASAYFz60MLbaM2AHacsrmpLIiqolS1h4xXUtxfMsJQgszfc/vvFoR5fhSCz7QiUjaacGeF5CxZFIitZKhcyQrnV0EeyGUx2tLVaElIdVssAqsAosbKlnwTCN5OB2zKkDnWhoeIFRkRRCjum5fKlqsyOwVRKRCFKFU2RcGtqKSoDYIq6WZNsDBKEzNjEvqhBqJFUXtu1CzMJ4m8QRCmfeI7atipvJmsA43HQxI5ul2KLDL14YzTlFhKT0VpTzAWBa8RKDkhodRyGs03keIYhDnJvArxxknFLCNbVqQGltlL/Ud+o4SLMIdZVzvVUAgLguqmNFuJ0GQY6vkLJ5TvfANmJLQaTF47MJiStOJDfSeuWlap5KT0+/fv35y2bwavDkZMtoYuKFouKoQs1NtDLlilmMctmO2YWMlM4UVAFHL3Q5SJ/wX4DFaD7EMzIuxK3r69OApCWYTLRL6qh/6PQlP7iA8/Luus8ZxWtbocx4ZT4u8GLQkp2oLkR17iiQCmHLBHCu8ariQFGTReW1uXQ5ZctNbzo3ThFvjj5skCfRALYAaE2z5L3RfZIF9gKJr3OpHM1HeVRiCDHY0GzsG2mmaimOhQ0IyIR1EB/tLFSO+kY8boFw6otMUZr9XMy+bssGup6RZWJagEnrzIGGwNgCMthbWEknsMPkrs6BvLAuxxfNXVEtuTPYjuiUtX4+jjG/j+iASD8fGOu59dxc60KfsnJoZv9vj07214JOQADoDFsbl9K/tC9KH8/V1UmYwiQMM+HxXrkSs9Vqm56vgfmwPSSle7gk4T1IFRExmazVFMdBjEdwwq84OVXU4mL+uH1UnhamiTVkOBh/ARDQmzTni+7Zi/SZZyjGB8dF8jC2iEueftpG6NAEP3CgDuLxmO69yy8uJkuTIw1Oa3opomIH45IuVJPKuCAXKkMrbdMcGQwpV56ba8sPx5RQk22bS3seFbtaG+WykbjIZR8QUURUgUtkhnxKw6YQKhYMHO2QFsIto5HRia5iR/5z9rVgCmstNjijaglbsViLUlR8tzE9fh0XulVL1H3Kmv9WaKYua4amm68fP3ns7Jtnzr3+GXTmpPTwPAcOeqFGWx0m8XRGd/IjxVZSRVbn/rHLVfPqa3ufdbVqLY3r2VEU35gJ3nxoBp53VEbstVtHpo6GT1zsC4zbspzhfX1R1/CfuLBvJAheDF6+7nmNU3wu9gNeTQwdKFTI0iXErrTm3YwrkNbi1eZ0WXGCwzk1CA1D60un0g6Peyq3GLQNbUcQQ3p4E2OwhbnUOAD4s9TZxMX9kLz0ykLf/ItXk75RiC8kqvsKseJM80jk/suePnJ4Muicb1/sH+pZjKfbuGKomPY/CwpMrDipINSBdYhLSEyHXE3iJVXlra21YC+EeIhLELsHQmNtY69JXLbji/Ha4dlH9Sks2waj7beW1DZ81MTbB5D2Z7Qdn6sHdaJLpmRKpmb4xwtLTvCzEp7ZBXG2wWloePW8jnMtk5GXeagcmpjl4/c63pbYCszWjqXTobEDBknWkpORXAPX6bHxrLws2+2FUPpEeilRPmEw861O0VFhbykuVNR0VoKBr+F0FAMEdAe7pB7C+kuH0h3XjLnEIt+RSE7FUhoQOYMhgvhQzSzX2cLuwNrhnKtYl4pytXu2KYlZD1v+lNmK3TS81zuJymMIQ7EznrZkO9yOotFEgl7V0XMiL+bufrldf4pLHZck1Gyqh4X63HOoGZtXVdpsdGMdx+Mq0CSud0QN/CLWTVXcGwXpykUKsc7+mlAg0i5JPC0VWyFVTSowP0zLNPHeniVZx00dm1c8cUZf69DTPCvRloGYjzjWo8hA7LkOqdnEUI2rGBBbNUsYN0maTMJNJlXUwN1C1ClUehaCdALlyxKXQeR5H27CuZvYOrgOzpYqpIxYMUtzJV2hJ7ldsn+OLZtw9BSl4kydq+L63IxG3JxZ6V3GVrwGqTJdPXTKSqKamID0zbvY6rzcC7Sqj9gSidmdsevty+EKINotxPwn4BfUTOWRacUM+uYmtl6mygaxUBroi1hjXd62cxQS29o6oZSd+6RZfpWJnmJLoXu1hBv+vp/dl1zNSfZ+uH6KTHMjzubkH2YQs4Ct1Vk6s/IXni9Wc6VC5Rvmv/MAwkgOxU8G2PJ6V926g5kwmpDD5K177jlezG6kmioPnj7rZNWUUEXr1x6rD6+mbqd/qgZJc3ttanxu4bhMKJIP+SII7cIkD/ZHTlE6ztOyXVBPidwXJ5GaZrOT3sX4VGlxeRz8jpSXFj7CVnfI6FiSZJpivpKWtGERcbI59YokoxhavtVIxQu19BlD+UHDblvTfzk6rnu2gOp/Fls3Iw3Z46ytHBoLDXmvL+u3X74urqx9/4PlVxf7a/3weDgjV8ziGz5Pg3R4HUwudBYCyF7xz93lWBDkoaHG9Ogek4mtCjNomd0fnGGaG11yuTeDKKuHZcaA2ezp5c7r3aXkRq7pk7S9ci57KJuoKuypDliyK9vBm0H/3eA7wynmeTqzVSbmYoCTcdKX//vHCY/iENq9l66xV268s91uY9DapBtsjawbQVfUVWt0zvovIC5CO8WSdaZZQ8z/e/DXv1lesAH45y/e477BevI9vTymLPQVE9OjZc49UL3T0Qk9gekbkAbu9Mliu91ekQvxUsto80hiy8YsNqYB8f5WbONt5abtaLF5JEhOBi+WmjKNxE0hMr5srU7SvdbMJ1JTus40ii51XEPMuLPXxIqtzrdPPRFJ4/kRQld2sI3al63+kioKhxnbIIVGduXNXpYkyKV0vZxXGhoAVRSniJjkIAkiRdc0Tij3L6jbcOGRN6ak4u024k1BB8lTW81J0eEz9swF+uzF2ZviPehJnj4PTu6ZF0YgpX1Ea4opKhy3a85AIjLoMIm5CUiTLbl4Iddmn5TrXK+uH02Yo5AajjHCHyD3Dlp04AhOrWP3zaJ32Nrv//DIH/+CdqIddTt3/1UzbgmbclwmwDrGp/S/LUO1CM5NI7Bu4md1oG6UiHf5RyZlM44NOsrMoQ1Qcmr0gn+rceC9EfVhNR0zsnfcrfCxuTU5MpoyYU8P1wvV7AP128m/FPQhUIUK4dyVlarS7KwU1Zv6eXM06fuQvuubJa8iX7WeF7Ug5h25D4irrQNAhohh4+A/sBnrfOYGGRRy8iqx2K9ZtYFGhFUZLpusqsDDZ6SaralnVAKSlUxCr4/1UyQSH2yA+g842gWrEP7YQgFgb5f83ZrL/CeuuS4nIp1o4lN7+/7x1i1oaSYepBuojq2BbWRdOke3CU+mt2vndp3yMGicdBbYnHS6HOJyBmPLLlanYz/+iEuWZuF2eq8+NiKU7OmpSxQO5zxVwODx/FLb6TJpP1Oxkudqk5HUTy3u0YHypSsbv/62uYyMnj7W91fhDz6Bzws0eBkCeXxCKp4/tixVlrpsjI9fns7sFaOa04zwyfI/iQPfl/480X4XZ56JxewVDYgHmKScrAp7mQnhrzoeb/+CIec7MKSvPCneEQkVnq3lnsoEb5rilfMeqCm0WFFUpCgO/UokNOic9dfnRGC1c9NJJLpkIpUnh9mtXYGjVrhK39JjY+nbd9dUeFVM3j30POCt1LUQO2Bo9+QhNbu382LSiKecvaQsDQ8vbSZSeXNo7tlkZ/VCFnDqbfyddW6Rv5rCh4RrLcCfwqNZmdDJGR4zLmFg4uHHKYpNT+GDvIqaz8qn7t1HxbBsqb0gFPHjwg0kOhmBcUw+x0QtJXIIk545C++e9eVGSoDzc2CNaLKEmhQKU6jlK5DQHL0l9GvuH6tmb0yaITZOinHyFOh5DqxpquClEnwc3j6A/GawxSc8QR/fxrrneV/63uM++B3zncO9wcnhXee4cDA5GJ8whcUrPiLMorj6NcKdjiEEcjjc6y45wlscrUMxo1PYySjeIRNaemS9vbL+0T9EcdeirsWJjBTA6tFpA+htFRcUF4pnz35WrR3VAt/1EQZu5XfuQu73Sm4YcbmGVbR4Bc+hm+P58ns/fnTg+/AdtMobilgC3f7D/VcJEkHvvTGRSjj8OR9UxMdv93ahWjQmUgu37321YQM4Npmyx91ocwI/ixSfKHOvrHzMhqpUXZ/Oc6JX7fMbj/RGPi4M3CrYqtdU9rP5R7X6w0Kd9pzgvF67RdAhGNNoxgQ6XXov+kHBbDCm1w3yV+SG+3VDvyqvT4H9I7T1rw9e9sps9w1186fP2Lh5jH9uq+Bob89KuS/0P88L3n65ywcRm8be3i2CwTFwbn8SvVdA/2uwh+8yMtgr8O1NVRZpNUuWyxMUr9X6VdTB8xP9IABRjkgaJU53i5UmooeCqcOfx6PjE9vbE+PR+KN4HeE+YQo6OygzICAzKBs9hXDhlA4/hkd3aKs1lRWaGm0HOilS5KYJqfKZIuvv957iU4k0ES6AR/5QAUaL2TmClWMobDriw5tSjgAapkaD0z44D+Q2StiVi5FjqGy0HF2eBqLc7pKzoCqAEqCAAXFgkJ0dMLhxHFbvoyktk2Plfho5Ru6r09M1MA89gl5uVFis/c6Wky7hP6WVV136PV56cQuHGQekr8JcgOxZs7O6QqmsUAvZUSuU6lSa0xVHBcfYnnPmHDNXcxZe3yg3TjJX5M+ocDLmXqbYfi14HGnBr979Lfs62DWH7blNsLXC9vGNKLMwd+Z1zfknCFhnFue6GsXz5omNrrmXec3FxnnzjOJc18uYhPrWI7t3F/HF9ivtYv+CiM3ZvTMfAy9fYS08QFfaU65qOj5BE3YO8jIaf2N8jDvsvou5rnPeLxeq6x6JTxa9UJhEgAX8rnKDxFFwY+P50j6obXEYISplIT1gVFM/iy8QizuvUvE85Tcvmu8+qo1hlaPDK+wj2N2xZVEWDUlPQ21yY7AEzgFHymdJqp27iiA/biJcewuUB7tGluCPXDckiYLDO+w4oZhWp1mBs4BYPtpY5mmR9vVJLZ5lHw0JzTlbpGWeHzGO9DYUQQAEFOI46RTJSnrBYT5LpJL6/HzT0nz81ujMzuCg/Pyg4DlEQNID6aQ8zgSStQl/PYrNcUcWLDgSF50B13xTtx1W7yd2Fca61f3Bj7dR21+emP/rrBYbjf2/xjnueUcv22eSEIsuz7KNOtSOkilLNLUuWa6h8vHR317MDfxZ9xiGbfp87EaQlRSAgC/wswCHvsUIoLO1nSlsAs8FOJ7sa8EGHsAksRad2F/ioA7Bx/tG5/o2UkscX56Qg3z5fpfnj7NhCsJ6W66Uoa+qlF4IfCebS8xLXI6GsT0j/Q2DIHSnNvxJDQfA1I7xp1UcCAZmcNkDRagMoAuXQmjHPD1dWG8ozpUYRd23zXVHRbmSy5hJSAPD67n9KB2FClDWRiCITllSDSMq1NN+6t6QQzc79ZOvXnkCY1AIggqiL53q0wxBd49APjSMVkC1QavgRDBzzg0XWipJWQOhUYHk6QTMwsdCbEIUVr1MjeahCIuxKbZEPGJ3FUH8J6JtnkF0QFqmxLggaEqUc9uzq3ZHpfZvgeHBn3soe903m5b85MQTBI2GN7GsUVUF6OfOc6A/pEY5QonjC+acdiFHUuJrJtCIq7YJ9F+X/bCJgbjBySgfFL6nmMSh+kPBzE1BgLwsEcNBuSEBLlJZZBRnCDs7hRli4zmxURWdnecxG8XnjKfImV1Sg6NkNjDgKBjh8JwY1BOwb8CVHt35jeNweeu5LzFUrTOWGqVfdkZ5bubtKaKt7lOSBrsdwO0GEg/oD/oj/IV7r7EqvJLmklxJlnhet/TV7qz+OFtQlHvJsWm4/1cI1+weOltkLoCPoshLZo7f3GAfy3qDRa9PrcDR9vK0Qbmn+Ff+YjLsMAkRVRKXmaNSHk8yPAJiEd/OoZ5fBsj8SdK9AWAFTBRTCLm68mR0F5pYDGtK4MgMSCJRq2lJauyTI1PO71/aaj1T0+ehcDm+BndGa2LLYJQAEczFkHEGbCIlcZGNgnksoFpJSpgPQdxBizCJwnQfvVNwpqDV460ykUGAmGrNemKaTfmbo0eCNjR0nLjuaOjALfrrL/UTtIC+K4A8G8VXUkawshWDtrgodiA3D8v/IdwDt2C6EeVE62UWOq0mft2dSiF1QhV52XehCjHJ5hqPjbKV6xbCyRCW3tDTrDaZDr1LUseH1qfp07T1uWN/ZdomaAwesz78KdPrRddPb9NBjA4csJ2+61qo4+apvYvDI3+6OdfZt92ad7+t88Dm0YHGJoXEUISe0j9nm5fh+lW42gfvyirh4fos2WgDy56lBko3W1W5uDV3cRI5ktQlLsxwDmclfH9+7gFVuSAFAiZ/xzxWN1OusYlk4vOpljH8xNvFMzVNUaIinqxKSGCb/mPedq53re15grmR2Njvorgk5E5xd5zBFV6S0in9loSX3yfWfVx8cNt2KFHdWZGgBurKOtRsKGlNWzAuvjev6moUd4euqt3dl5v9VUzuuP9kKmcpNRUatf6zeFJmpb+NxM2OFmACvKAHAeYccaa4q0uU6ZozRiQ0sUxxjnjM4OdyYl7cae5KzN7loCRtw5+5JlSfbNWD0QSv3+k4h7glGy82rWE8yI+9A5DfUXFqYQpqm543SVi/dK14/2iZ6VgVfUsff8ndvLuAGub2BzQD1sCFjSSKxANzuXbzIsKufa+HnpbRVDxljEjVRrM7b6hRwovQ7QfNCgewgpQub/XHnJIwoKQqWWH3eOBSu+kLFGEUlDrb8uqKcKvzhJ8xU1Ez4X9EES0DzPYBYPruVO/Ue2Ta1tcSEmJSmD8TqYEpxKL4bM5xoZ1Cfxo1K2r6xj3HT+iuD16/uQTntX7ahrIXz2sY9rqS9onYzrMVNyNWNbf+k1Txwg44Uuw93MhO/4UlCBJXenFyg+He86XXG04syrxDhyaJsmZlDtwtZZPxhyxh+9dT3gWyfGjciY0v6WJTs+TVqlIPNy7vI1ZXwSjxFd9tGnHNC8lbwROqY7psg0WFdbY/ZyJqSCYHk3RukG0cQYCn+LVxTHn3DStHo/gxfoyyF8NRiBZub7rluAWZZKNqunR2wfd9solNqY6v/5wWE0ikCWVZTFgX2MQIGkfFhdTOQ95ilK9p4jDxW/1gExQd/Qeh9Ij7P64outqyxb/YPaYTc7gZo1MS55tKY93eoLWkfMYhIC3FG8T2NgPo9uuLJUXMqd3dQeglQQa0HSEoBbXnxKIzFbj7mSk7eTaSI9cOwmhKHO2uunvL3CUdAOPvmoz4QeYbV5BocjEdt/bCGIihOeuXd3dD6r88uB3pCbMrudeeLLlxk56eT44JPk0mGHCYe6J1+gobLOOZ+ioej4VlMeTTKKzuRCkTR2Zmtthee1zoo8S8onEf7lxQ94ew8/+FO7l1jmBPgoJ0oPC2pyQtFP4Zw5ZfQTQ9BOV79zF7yoxbTq+mh3eFFYYBX7kgQawTbRFrxQlOc1tEOt/774lHbY4SXf3iwlMJCV7zyK7zxCOsI8SLhCM290HT9HfcNhE3Z6ELY2tX8L57AzcWtXwj0TzS/u0p8PtbGknxzmlTsYS8LPmCN4/ewrtZ/1K9spSehy1hZt4zij6ZDLZBmHEpmOr+GCotCH+TEvWGwc8bcXEaeeoJZXDjwdR4GVyZDLrdASAOMYeIwNcwaHSoX2RczIm6G0zCNscLdzwL0+KNyZWC1wlZev0qee0+jMlp8Z6Fdy74P9qk2vTIyT4HKo5M0sZ/SOcQCY0JFefYO+FzoOeulh56RygZeO+Ia6gZUmfNiyUwQprWHreWB6p8Mnhs9qrwUb2+rMdvUwgOiZ2XNaQ+m/niULHj+4ESAggtcDwdnSteXhTy5xPEV0PRyBFLRJZFCV79/wrpANVBJYhm89H+bWyvay4/2Vc92ccGP1fZPy8f/LB//pkMI/E/eysxRfpk/3HOF6KVdHIrdp/cR8S6YTdd6WSMH2D3GHd3MT7tiwMVdaI/vwmwbLozVvCNt1P6dGEzcyqzsuX4W8FvRq1zLUNzxTw83HabYfA4O9zqkbbugU9Vvf+sT1Oz8n0erEuTDrfVVwX/dsC+z1gshDIr5mOcCJFVA0xtjaa8PglFILnvUB1uHl7p3I5hpr6le0Z4Rq0wqkTXse4xmes8ImUx+c30DNnB8Oj8+SACv/Ck1ezyPWYkx0eZw8Tqsm5Yvv831j+FUJDXvJT3e34mbGIB4cqdzYeVODXBjYgk+qSqyvS14wNVhCiULZLioRFMX3Kowu4pvCf1v5dT9xn9HeCcNM8oz7Phc8zWUycCCy3e4PKnB/1NGjMJZ/VVSyPlKa56jwQ/xCzfrRZHd3hEAWKywdDop/2UYrBUVR3mHR4YsCDxo86/QfLQbq09841Z6/WJmhKQ4KnWhDQPT/LNvrRQG+Kh9k8gp7h+ArK+Zk6/sl9xUHmwdoS9RTGI9tlynWPgLC4kipOuXffuBc/6TPO7iwzcuWyHOCduJ3f/f/9NvgRDXdXsaALJK8Lr6sJXpNjR5EqWsMhhsrKO5UIPcS9o/7UIjXI68D6lA9Oq9WKFf1buSuCSQxbgekGNc6VHurqvaXqf+tk2uPVeXuiAV3vn6GmP8LDh7FALY9FcbylRKwfQ05p78R793qaeV6cw2XH4DqTzFnZTPMiat+Vm5+1vA99uD3Qtg45m56G7T91Q4NAZd3cIcJGqDTAn6iwKiTqLJoN5cbfv62ITFjSEG9Tib9HtfTFtbTGJoercF3/PSaXqpdrMyY3njQcyNa58XQov6ltg3v3yC1PzM2VqPQ2E+fIgcOnC3n4HBVnmBCCIOW2Xs/20Za0YjI0wEI9HuDSYBnnbFV65eWMle+XyZZ0tm4xwMJt4l+jphmQtK+i83a5kAyXULDaYVd7RfukcE7+0uJCfzn6tau8GU4KpXhUxfj+3k/nFZSZ+BjvKT+VdpJVY/9NUaVT1XURW1VEdIiRosqWRUrfoTEcoTzOalIKSFIqW8pKi4Wjcoz9N1XxSNsk/4H6pL6QVFoYHmxUlTQK1Q4ZvqtlrmzQrPWvFxwwdqptaxscVqQ5Jt3mZfVMzHNSCJkVJsNnGydUcj/ztGLLbePGXxl3z6+I+OzZW+wM0AwBIiLIZjIDy0wyUQGg0nju3RWOrt4+dURJuVoSaw0p/hpVo3ebQkrCfpWE+FObwkhmx9npbzaFz5wVtvIxYabS7e7Q0dhcR0KBz1rueM2cCEIDYDYl8RThhvujetJLM9EacKMSJfG8N+5PpjnRyN+A58kLXPU9I8KsF/J8QoyqrpO3sf4Th4vxIJbkuP5gGq6D/1J8g2Fv1c0GLkkZYYFB++lwvKstThdR7tWtydt4QonKtTzsN1G4awq3wS8TRfWkI2qTpgecqXswP4pgdwo0Mg03P/Vqbypac9EqW0inyeKTjic0LFqw9+0Vlu8tRHzEzPae6tYY5GNYCQRh0Pa5HfoKwuTjxWGfnscTLREKTDgSsexsdnSvOFp41ZNYlS8S5wuyzQEAzWcxTQv/SZgzNuPLB7T7uwhknCo2KgqPy8iMBlc7hTRTBHR2QCUVKPWhLpVPhxWdGlyJUPru38fMu5N07ZBd5sAxwEeXPL1crCgkpIkVbNBGKc0ikCPIcXDLEpPSv/OMd8xCtgWumbe6u+T8XXG1tK5Y0lLrNemxM9KnV6LxSOLHO/8M3ItRoo7/MXjqVV3V6Eo6gq1NpKmdpqrSJrlqVtmqWtvLKdSAE4jppnYCzqGFrZq5GTj6UIDRptLSQ9d9YpVvlWONkPz8ntx5+AOEC3tuxJj6RDTvnx0929CTcxwfyu8xsZmSZ7Ufbg7aPWP/YPvR9f2IB32doHHHRV77R2KhusLGxqBuNRn4CnoTDWhqWbIuzs27kuLY9aY+PgJnW71brP9bmANYhJxG1bh5wDolODziBaAafcw8JqBiRRAXsfUoRhfVNWVDeyFaNfdw6JAIAAJDj8ANt3MGMQbS0vNJy12ZEbA2jOSGkBYp8Ixg1iIzius1UASLC+IXGkaq0VCbVL8SJtGdu8ROpZnXm044iESCxTGU9+LiZiCB2yQXEu4peLTJ2yR1Epvfykj0TtQRpBQAAFIB/aMZaw0gB2M/bh/hb/zXoWxp9oYmqzaceIhxaFgQfAgAAZAU8VTNWcEaadPMHcgixZ91pSkk3FkTqRNKHHZepMWgFkgSDH+tDeIOPeIREjbuhA8H+c0pLYHZBfHceNfQbjvg/LKMeXJ7b7uPuIMG3o48C8CfGoq1CQA4GiWx0MoG7Mql/PRkOQDDqJqfIqbW+iWdegutknfEuiDATTEqFWYJyk9B3iU6e1WLa4/DK+q94kxNpUrp0w0ODwW/ANGAAAAEtAMC/rOzHAA/lUsqkFl2Cey+FHvfBAqdYQAAO8HlUF3cBDYjAV8AAHAgTCEAKdMsmAiaoAgiAUHgAgBi0aQIEaGBAgAEFHBIQQAOjPKrLLQENbMErAQNo4F+BANIgsjsiEOv284siGE7OL46CcGSZ+Rf3J6ZeQIvG/EVthFHu6iXLjv+BjHoJh/ZKN7Pookp1362bhqWIm1XuGOyUzebPs7cZ5/kUpK6+KILh5PjF3TwF4ThrS7/3fmLqBZSS/6tpM0T94jtXJxcK/gdlqkkKktxe6cZ0LTqHqD6uOt8fNSxvpjgz3rhjeNNPcglj/nRGs4q09FR9aR2QFKjdZO3FBxcgQYEGAxY8wL9R+tUBBwQBhBCNJ9PZfLFc5fWNza3tnd29/YPDo+OT07Pzi8ur65vbu/uHx6fnl9e3d4PiNJEdiZtBUqhjAU4dEh49me/hgbaN8NwVCY+hGfXDvOx8kbSrQGWISsjTVlv7iL2UFhSRtzDT4U7ALfd9haXz/o3kZfRUyHE7TNIX4t3rhv92oU083DveSbf6jSGDbZ7PMUJAL/I42JvMUPf/M+X+JasHHgwEweVg0o1AxkL8wIl4nCT0imybFocgOYc0JLIC/qP1lJB3RbiEwolRZMgdeNL2HoX0ug9SRPdiGfUYZF6UUrZ90l5xiwvuGHrqmz5vea5DQ9CQDxVbkxE+A9dYrCJI7n708sClA+8mMDxACNLZxpCwJ9Fll4UVbmR1tQI=) format("woff2"),url(/blog/assets/fonts/iconfont.938fa69e.woff) format("woff"),url(/blog/assets/fonts/iconfont.ecabaf00.ttf) format("truetype")}.iconfont{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.reco-reddit:before{content:"\e701"}.reco-instagram:before{content:"\e6fc"}.reco-language:before{content:"\e65e"}.reco-bitbucket:before{content:"\eb57"}.reco-faq:before{content:"\e643"}.reco-lock:before{content:"\e60f"}.reco-sticky:before{content:"\e62b"}.reco-blog:before{content:"\e61d"}.reco-mail:before{content:"\e624"}.reco-friend:before{content:"\e62f"}.reco-rss:before{content:"\f09d"}.reco-fullscreen:before{content:"\e602"}.reco-api:before{content:"\e662"}.reco-jianshu:before{content:"\e60c"}.reco-mayun:before{content:"\e6d0"}.reco-weibo:before{content:"\e612"}.reco-bilibili:before{content:"\e630"}.reco-douyin:before{content:"\e654"}.reco-v2ex:before{content:"\e62a"}.reco-csdn:before{content:"\e609"}.reco-juejin:before{content:"\e613"}.reco-wechat:before{content:"\e720"}.reco-qq:before{content:"\e67b"}.reco-facebook:before{content:"\e606"}.reco-twitter:before{content:"\e60b"}.reco-zhihu:before{content:"\e605"}.reco-douban:before{content:"\e603"}.reco-taobao:before{content:"\e6a5"}.reco-toutiao:before{content:"\e6b7"}.reco-linkedin:before{content:"\e668"}.reco-document:before{content:"\e67a"}.reco-sf:before{content:"\e610"}.reco-coding:before{content:"\e601"}.reco-gitlab:before{content:"\e63c"}.reco-suggestion:before{content:"\e608"}.reco-tongzhi:before{content:"\e764"}.reco-huawei:before{content:"\e6b9"}.reco-beian:before{content:"\e667"}.reco-color:before{content:"\eae9"}.reco-other:before{content:"\e60e"}.reco-copyright:before{content:"\ef87"}.reco-theme:before{content:"\e7e8"}.reco-eye:before{content:"\e669"}.reco-menu:before{content:"\e67c"}.reco-up:before{content:"\e68b"}.reco-npm:before{content:"\e88d"}.reco-search:before{content:"\e611"}.reco-message:before{content:"\e634"}.reco-three:before{content:"\e644"}.reco-github:before{content:"\e628"}.reco-bokeyuan:before{content:"\e626"}.reco-date:before{content:"\e63b"}.reco-account:before{content:"\e607"}.reco-category:before{content:"\e61e"}.reco-home:before{content:"\e65b"}.reco-tag:before{content:"\e633"}.content{margin:4rem auto 0;max-width:800px;padding:0 2rem}.mod_404 .desc .desc_link{display:inline-block;background:#424242!important;color:#fff;padding:6px 20px!important;text-decoration:none!important;border-radius:4px}@media screen and (max-width:720px){.mod_404 .desc{margin:50px 0}.mod_404 .wrapper{margin:0!important;padding-top:20px}}code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.categories-wrapper[data-v-1e68bc8d]{max-width:860px;margin:0 auto;padding:4.6rem 2.5rem 0}.categories-wrapper .category-wrapper[data-v-1e68bc8d]{list-style:none;padding-left:0}.categories-wrapper .category-wrapper .category-item[data-v-1e68bc8d]{vertical-align:middle;margin:4px 8px 10px;display:inline-block;cursor:pointer;border-radius:.25rem;font-size:13px;box-shadow:var(--box-shadow);transition:all .5s;background-color:var(--background-color)}.categories-wrapper .category-wrapper .category-item.active[data-v-1e68bc8d],.categories-wrapper .category-wrapper .category-item[data-v-1e68bc8d]:hover{background:#3eaf7c}.categories-wrapper .category-wrapper .category-item.active a span.category-name[data-v-1e68bc8d],.categories-wrapper .category-wrapper .category-item:hover a span.category-name[data-v-1e68bc8d]{color:#fff}.categories-wrapper .category-wrapper .category-item.active a span.category-name .post-num[data-v-1e68bc8d],.categories-wrapper .category-wrapper .category-item:hover a span.category-name .post-num[data-v-1e68bc8d]{color:#3eaf7c}.categories-wrapper .category-wrapper .category-item a[data-v-1e68bc8d]{display:flex;box-sizing:border-box;width:100%;height:100%;padding:8px 14px;justify-content:space-between;align-items:center;color:#666}.categories-wrapper .category-wrapper .category-item a .post-num[data-v-1e68bc8d]{margin-left:4px;width:1.2rem;height:1.2rem;text-align:center;line-height:1.2rem;border-radius:.25rem;font-size:.7rem;color:#fff}@media (max-width:719px){.categories-wrapper[data-v-1e68bc8d]{padding:4.6rem 1rem 0}.page-edit .edit-link[data-v-1e68bc8d]{margin-bottom:.5rem}.page-edit .last-updated[data-v-1e68bc8d]{font-size:.8em;float:none;text-align:left}}.content__default code{color:#505050;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:var(--code-color);border-radius:3px}.content__default code .token.deleted{color:#ec5975}.content__default code .token.inserted{color:#3eaf7c}.content__default pre,.content__default pre[class*=language-]{line-height:1.4;padding:1.25rem 1.5rem;margin:.85rem 0;background-color:#282c34;border-radius:6px;overflow:auto}.content__default pre[class*=language-] code,.content__default pre code{color:#fff;padding:0;background-color:transparent;border-radius:0}div[class*=language-]{position:relative;background-color:#282c34;border-radius:6px}div[class*=language-] .highlight-lines{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlighted{background-color:rgba(0,0,0,.66)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent;position:relative;z-index:1}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}div[class*=language-]:not(.line-numbers-mode) .line-numbers-wrapper{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlighted{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{content:" ";position:absolute;z-index:3;left:0;top:0;display:block;width:2.5rem;height:100%;background-color:rgba(0,0,0,.66)}div[class*=language-].line-numbers-mode pre{padding-left:3.5rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers-wrapper{position:absolute;top:0;width:2.5rem;text-align:center;color:hsla(0,0%,100%,.3);padding:1.25rem 0;line-height:1.4}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number,div[class*=language-].line-numbers-mode .line-numbers-wrapper br{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number{position:relative;z-index:4;font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;z-index:2;top:0;left:0;width:2.5rem;height:100%;border-radius:6px 0 0 6px;border-right:1px solid rgba(0,0,0,.66);background-color:#282c34}div[class~=language-js]:before{content:"js"}div[class~=language-ts]:before{content:"ts"}div[class~=language-html]:before{content:"html"}div[class~=language-md]:before{content:"md"}div[class~=language-vue]:before{content:"vue"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"stylus"}div[class~=language-go]:before{content:"go"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-sh]:before{content:"sh"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-py]:before{content:"py"}div[class~=language-docker]:before{content:"docker"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-makefile]:before{content:"makefile"}div[class~=language-javascript]:before{content:"js"}div[class~=language-typescript]:before{content:"ts"}div[class~=language-markup]:before{content:"html"}div[class~=language-markdown]:before{content:"md"}div[class~=language-json]:before{content:"json"}div[class~=language-ruby]:before{content:"rb"}div[class~=language-python]:before{content:"py"}div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}.custom-block .title{font-weight:600;margin-bottom:-.4rem}.custom-block.danger,.custom-block.tip,.custom-block.warning{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-block.tip{background-color:var(--code-color);border-color:#67cc86}.custom-block.tip .title{color:#67cc86}.custom-block.warning{background-color:var(--code-color);border-color:#fb9b5f}.custom-block.warning .title{color:#fb9b5f}.custom-block.danger{background-color:var(--code-color);border-color:#f26d6d}.custom-block.danger .title{color:#f26d6d}.custom-block.right{color:rgba(0,0,0,.4);font-size:.9rem;text-align:right}.custom-block.theorem{margin:1rem 0;padding:.1rem 1.5rem;border-radius:.4rem;background-color:var(--code-color)}.custom-block.theorem .title{font-weight:700}.custom-block.details{display:block;position:relative;border-radius:2px;margin:1em 0;padding:1rem;background-color:var(--code-color)}.custom-block.details h4{margin-top:0}.custom-block.details figure:last-child,.custom-block.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-block.details summary{outline:none;cursor:pointer}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-bottom:6px solid var(--text-color-sub)}.arrow.down,.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent}.arrow.down{border-top:6px solid var(--text-color-sub)}.arrow.right{border-left:6px solid var(--text-color-sub)}.arrow.left,.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent}.arrow.left{border-right:6px solid var(--text-color-sub)}.content__default:not(.custom){max-width:860px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.content__default:not(.custom){padding:2rem}}@media (max-width:419px){.content__default:not(.custom){padding:1.5rem}}.table-of-contents .badge{vertical-align:middle}body,html{padding:0;margin:0}body{font-family:Ubuntu,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:15px;color:var(--text-color);background-color:var(--background-color)}.page,.password-wrapper-in{overflow-x:hidden;margin-left:18rem}.navbar{z-index:20;right:0;height:3.6rem;box-sizing:border-box}.navbar,.sidebar-mask{position:fixed;top:0;left:0}.sidebar-mask{z-index:9;width:100vw;height:100vh;display:none;background-color:rgba(0,0,0,.65)}.sidebar{font-size:16px;background-color:var(--background-color);width:18rem;position:fixed;z-index:10;margin:0;top:3.6rem;left:0;bottom:0;box-sizing:border-box;border-right:1px solid var(--border-color);overflow-y:auto}.content__default:not(.custom) a:hover{text-decoration:underline}.content__default:not(.custom) p.demo{padding:1rem 1.5rem;border:1px solid #ddd;border-radius:4px}.content__default:not(.custom) img{max-width:100%}.content__default:not(.custom) :first-child{margin-top:0}.content__default.custom{padding:0;margin:0}.abstract img,.content__default.custom img{max-width:100%}a{font-weight:500;text-decoration:none}a,p a code{color:#3eaf7c}p a code{font-weight:400}kbd{background:#eee;border:.15rem solid #ddd;border-bottom:.25rem solid #ddd;border-radius:.15rem;padding:0 .15em}blockquote{font-size:.9rem;color:#999;border-left:.25rem solid #999;background-color:var(--code-color);margin:.5rem 0;padding:.25rem 0 .25rem 1rem}blockquote>p{margin:0}ol,ul{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:500;line-height:1.25}.content__default:not(.custom)>h1,.content__default:not(.custom)>h2,.content__default:not(.custom)>h3,.content__default:not(.custom)>h4,.content__default:not(.custom)>h5,.content__default:not(.custom)>h6{margin-top:-1.5rem;padding-top:3.6rem;margin-bottom:1rem}.content__default:not(.custom)>h1:first-child,.content__default:not(.custom)>h2:first-child,.content__default:not(.custom)>h3:first-child,.content__default:not(.custom)>h4:first-child,.content__default:not(.custom)>h5:first-child,.content__default:not(.custom)>h6:first-child{margin-top:-3.5rem}h1{font-size:1.6rem}h2{font-size:1.4rem}h3{font-size:1.2rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0}a.header-anchor:hover{text-decoration:none}.line-number,code,kbd{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}ol,p,ul{line-height:2.2}hr{border:0;border-top:1px solid var(--border-color)}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto}tr{border-top:1px solid var(--border-color)}tr:nth-child(2n){background-color:var(--code-color)}td,th{border:1px solid var(--border-color);padding:.6em 1em}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.no-navbar .content__default:not(.custom)>h1,.theme-container.no-navbar h2,.theme-container.no-navbar h3,.theme-container.no-navbar h4,.theme-container.no-navbar h5,.theme-container.no-navbar h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .sidebar{top:0}@media (min-width:720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page,.theme-container.no-sidebar .password-wrapper-in{margin-left:0}}@media (max-width:959px){.sidebar{font-size:15px;width:14.76rem}.page,.password-wrapper-in{margin-left:14.76rem}}@media (max-width:719px){.sidebar{top:0;padding-top:3.6rem;transform:translateX(-100%);transition:transform .2s ease}.page,.password-wrapper-in{margin-left:0}.theme-container.sidebar-open .sidebar{transform:translateX(0)}.theme-container.no-navbar .sidebar{padding-top:0}.password-shadow{padding-left:0}}@media (max-width:419px){h1{font-size:1.9rem}.content__default div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}.iconfont{font-family:iconfont,Ubuntu,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif!important;font-size:13px;color:var(--text-color-sub)}::-webkit-scrollbar{width:5px;height:5px}::-webkit-scrollbar-thumb:vertical{height:5px;background-color:#3eaf7c}::-webkit-scrollbar-thumb:horizontal{width:5px;background-color:#3eaf7c}.vuepress-flowchart{overflow:auto}.sw-update-popup{border-radius:.25rem!important;box-shadow:var(--box-shadow)!important;color:var(--text-color)!important;background:var(--background-color)!important;border:none!important}.sw-update-popup>button{background:#3eaf7c;border-radius:.25rem;color:#fff;-webkit-tap-highlight-color:rgba(0,0,0,0);border:none}.tag-wrapper[data-v-25a0fadc]{max-width:860px;margin:0 auto;padding:4.6rem 2.5rem 0}@media (max-width:719px){.tag-wrapper[data-v-25a0fadc]{padding:4.6rem 1rem 0}}.tags-wrapper[data-v-615c9794]{max-width:860px;margin:0 auto;padding:4.6rem 2.5rem 0}@media (max-width:719px){.tags-wrapper[data-v-615c9794]{padding:5rem .6rem 0}}.timeline-wrapper[data-v-42b59284]{max-width:860px;margin:0 auto;padding:4.6rem 2.5rem 0}.timeline-wrapper .timeline-content[data-v-42b59284]{box-sizing:border-box;position:relative;list-style:none}.timeline-wrapper .timeline-content[data-v-42b59284]:after{content:" ";position:absolute;top:14px;left:0;z-index:-1;margin-left:-2px;width:4px;height:100%;background:var(--border-color)}.timeline-wrapper .timeline-content .desc[data-v-42b59284],.timeline-wrapper .timeline-content .year[data-v-42b59284]{position:relative;color:var(--text-color);font-size:16px}.timeline-wrapper .timeline-content .desc[data-v-42b59284]:before,.timeline-wrapper .timeline-content .year[data-v-42b59284]:before{content:" ";position:absolute;z-index:2;left:-20px;top:50%;margin-left:-4px;margin-top:-4px;width:8px;height:8px;background:var(--background-color);border:1px solid var(--border-color);border-radius:50%}.timeline-wrapper .timeline-content .year[data-v-42b59284]{margin:80px 0 0;color:var(--text-color);font-weight:700;font-size:26px}.timeline-wrapper .timeline-content .year-wrapper[data-v-42b59284]{padding-left:0!important}.timeline-wrapper .timeline-content .year-wrapper li[data-v-42b59284]{display:flex;padding:30px 0 10px;list-style:none;border-bottom:1px dashed var(--border-color);position:relative}.timeline-wrapper .timeline-content .year-wrapper li:hover .date[data-v-42b59284]{color:#3eaf7c}.timeline-wrapper .timeline-content .year-wrapper li:hover .date[data-v-42b59284]:before{background:#3eaf7c}.timeline-wrapper .timeline-content .year-wrapper li:hover .title[data-v-42b59284]{color:#3eaf7c}.timeline-wrapper .timeline-content .year-wrapper li .date[data-v-42b59284]{width:40px;line-height:30px;color:var(--text-color-sub);font-size:12px}.timeline-wrapper .timeline-content .year-wrapper li .date[data-v-42b59284]:before{content:" ";position:absolute;left:-18px;top:41px;width:6px;height:6px;margin-left:-4px;background:var(--background-color);border-radius:50%;border:1px solid var(--border-color);z-index:2}.timeline-wrapper .timeline-content .year-wrapper li .title[data-v-42b59284]{line-height:30px;color:var(--text-color-sub);font-size:16px;cursor:pointer}@media (max-width:719px){.timeline-wrapper[data-v-42b59284]{margin:0 1.2rem}} \ No newline at end of file diff --git a/assets/fonts/iconfont.938fa69e.woff b/assets/fonts/iconfont.938fa69e.woff new file mode 100644 index 0000000..d2e44dc Binary files /dev/null and b/assets/fonts/iconfont.938fa69e.woff differ diff --git a/assets/fonts/iconfont.ecabaf00.ttf b/assets/fonts/iconfont.ecabaf00.ttf new file mode 100644 index 0000000..eb85b12 Binary files /dev/null and b/assets/fonts/iconfont.ecabaf00.ttf differ diff --git a/assets/img/HTTP-HTTPS.414eeca3.png b/assets/img/HTTP-HTTPS.414eeca3.png new file mode 100644 index 0000000..9224c0c Binary files /dev/null and b/assets/img/HTTP-HTTPS.414eeca3.png differ diff --git a/assets/img/JavaScriptArray.d4585bee.png b/assets/img/JavaScriptArray.d4585bee.png new file mode 100644 index 0000000..7a6693f Binary files /dev/null and b/assets/img/JavaScriptArray.d4585bee.png differ diff --git a/assets/img/MVVM.995f6ae8.jpg b/assets/img/MVVM.995f6ae8.jpg new file mode 100644 index 0000000..c29a08d Binary files /dev/null and b/assets/img/MVVM.995f6ae8.jpg differ diff --git a/assets/img/Observer.7e9d337a.png b/assets/img/Observer.7e9d337a.png new file mode 100644 index 0000000..4b351d7 Binary files /dev/null and b/assets/img/Observer.7e9d337a.png differ diff --git a/assets/img/SPA.bb5b901f.png b/assets/img/SPA.bb5b901f.png new file mode 100644 index 0000000..72fb570 Binary files /dev/null and b/assets/img/SPA.bb5b901f.png differ diff --git a/assets/img/Vue_life.17aa5486.jpg b/assets/img/Vue_life.17aa5486.jpg new file mode 100644 index 0000000..6175dca Binary files /dev/null and b/assets/img/Vue_life.17aa5486.jpg differ diff --git a/assets/img/base_data.094dbf9d.png b/assets/img/base_data.094dbf9d.png new file mode 100644 index 0000000..c6e1993 Binary files /dev/null and b/assets/img/base_data.094dbf9d.png differ diff --git a/assets/img/bg.2cfdbb33.svg b/assets/img/bg.2cfdbb33.svg new file mode 100644 index 0000000..f576b34 --- /dev/null +++ b/assets/img/bg.2cfdbb33.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/dns-query.50e6d2a4.png b/assets/img/dns-query.50e6d2a4.png new file mode 100644 index 0000000..3884642 Binary files /dev/null and b/assets/img/dns-query.50e6d2a4.png differ diff --git a/assets/img/event_loop.27d58f28.png b/assets/img/event_loop.27d58f28.png new file mode 100644 index 0000000..3a48cac Binary files /dev/null and b/assets/img/event_loop.27d58f28.png differ diff --git a/assets/img/fdjl.d94de3e2.png b/assets/img/fdjl.d94de3e2.png new file mode 100644 index 0000000..97bcb0b Binary files /dev/null and b/assets/img/fdjl.d94de3e2.png differ diff --git a/assets/img/http-request.e1203d0f.png b/assets/img/http-request.e1203d0f.png new file mode 100644 index 0000000..60ca13b Binary files /dev/null and b/assets/img/http-request.e1203d0f.png differ diff --git a/assets/img/https-process.9ac914dc.png b/assets/img/https-process.9ac914dc.png new file mode 100644 index 0000000..e8e6af4 Binary files /dev/null and b/assets/img/https-process.9ac914dc.png differ diff --git a/assets/img/https.e2a94c20.png b/assets/img/https.e2a94c20.png new file mode 100644 index 0000000..ea54a46 Binary files /dev/null and b/assets/img/https.e2a94c20.png differ diff --git a/assets/img/isscroll.1ac89f54.png b/assets/img/isscroll.1ac89f54.png new file mode 100644 index 0000000..fc85030 Binary files /dev/null and b/assets/img/isscroll.1ac89f54.png differ diff --git a/assets/img/page-render.e17c9ae0.png b/assets/img/page-render.e17c9ae0.png new file mode 100644 index 0000000..c4588d2 Binary files /dev/null and b/assets/img/page-render.e17c9ae0.png differ diff --git a/assets/img/readyState.51fb7675.png b/assets/img/readyState.51fb7675.png new file mode 100644 index 0000000..a2a5a96 Binary files /dev/null and b/assets/img/readyState.51fb7675.png differ diff --git a/assets/img/scroll.5e769a62.png b/assets/img/scroll.5e769a62.png new file mode 100644 index 0000000..0626815 Binary files /dev/null and b/assets/img/scroll.5e769a62.png differ diff --git a/assets/img/status.78d4d753.png b/assets/img/status.78d4d753.png new file mode 100644 index 0000000..5196283 Binary files /dev/null and b/assets/img/status.78d4d753.png differ diff --git a/assets/img/tcp-complete.9803c523.png b/assets/img/tcp-complete.9803c523.png new file mode 100644 index 0000000..37e5bd0 Binary files /dev/null and b/assets/img/tcp-complete.9803c523.png differ diff --git a/assets/img/tcp-four.fc8c0dfd.png b/assets/img/tcp-four.fc8c0dfd.png new file mode 100644 index 0000000..d1e7439 Binary files /dev/null and b/assets/img/tcp-four.fc8c0dfd.png differ diff --git a/assets/img/tcp-three-four.e233340e.png b/assets/img/tcp-three-four.e233340e.png new file mode 100644 index 0000000..20c1d5e Binary files /dev/null and b/assets/img/tcp-three-four.e233340e.png differ diff --git a/assets/img/tcp-three.fc6f7709.png b/assets/img/tcp-three.fc6f7709.png new file mode 100644 index 0000000..9be187c Binary files /dev/null and b/assets/img/tcp-three.fc6f7709.png differ diff --git a/assets/img/tcp.3243c763.png b/assets/img/tcp.3243c763.png new file mode 100644 index 0000000..9cbc15c Binary files /dev/null and b/assets/img/tcp.3243c763.png differ diff --git a/assets/img/two_way.c6a64705.jpg b/assets/img/two_way.c6a64705.jpg new file mode 100644 index 0000000..d4985d7 Binary files /dev/null and b/assets/img/two_way.c6a64705.jpg differ diff --git a/assets/img/url.1aa6edf7.png b/assets/img/url.1aa6edf7.png new file mode 100644 index 0000000..ffa8d60 Binary files /dev/null and b/assets/img/url.1aa6edf7.png differ diff --git a/assets/img/xmlHttpRequest.e50c8622.png b/assets/img/xmlHttpRequest.e50c8622.png new file mode 100644 index 0000000..82a73fd Binary files /dev/null and b/assets/img/xmlHttpRequest.e50c8622.png differ diff --git a/assets/js/1.8850014e.js b/assets/js/1.8850014e.js new file mode 100644 index 0000000..6c2cf14 --- /dev/null +++ b/assets/js/1.8850014e.js @@ -0,0 +1,8 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{423:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(72);function r(){var e=Object(o.d)();if(!e)throw new Error("must be called in setup");return e||{}}},424:function(e,t,n){"use strict";n.d(t,"b",(function(){return g})),n.d(t,"a",(function(){return y}));var o=n(480),r=n.n(o),a=n(19),i=n(28),s=n(138),c=n(137),l=n(134),u=(n(227),n(95),n(38),n(48),n(131),n(481),n(442),n(0)),f=n(16),d=function(e,t,n,o){var r,a=arguments.length,i=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"===("undefined"==typeof Reflect?"undefined":Object(l.a)(Reflect))&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},p=/^(\w+)\-/,h=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"getClass",value:function(e){return p.test(e)?e.replace(p,(function(){return"reco"===(arguments.length<=1?void 0:arguments[1])?"iconfont ".concat(arguments.length<=0?void 0:arguments[0]):"".concat(arguments.length<=1?void 0:arguments[1]," ").concat(arguments.length<=0?void 0:arguments[0])})):e}},{key:"go",value:function(e){""!==e&&window.open(e)}},{key:"render",value:function(){var e=arguments[0];return e("i",r()([{},{class:this.getClass(this.icon),on:{click:this.go.bind(this,this.link)}}]),[this.$slots.default])}}]),n}(u.default.extend({props:{icon:{type:String,default:""},link:{type:String,default:""}}})),g=h=d([f.b],h),v=n(6),m=function(e,t,n,o){var r,a=arguments.length,i=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"===("undefined"==typeof Reflect?"undefined":Object(l.a)(Reflect))&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(i=(a<3?r(i):a>3?r(t,n,i):r(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},b=function(e){Object(s.a)(n,e);var t=Object(c.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"setStyle",value:function(e){e.style.transition="transform ".concat(this.duration,"s ease-in-out ").concat(this.delay,"s, opacity ").concat(this.duration,"s ease-in-out ").concat(this.delay,"s"),e.style.transform=this.transform[0],e.style.opacity=0}},{key:"unsetStyle",value:function(e){e.style.transform=this.transform[1],e.style.opacity=1}},{key:"render",value:function(){var e=arguments[0];return e("transition",{attrs:Object(v.a)({},{name:"module"}),on:Object(v.a)({},{enter:this.setStyle,appear:this.setStyle,"before-leave":this.setStyle,"after-appear":this.unsetStyle,"after-enter":this.unsetStyle})},[this.$slots.default])}}]),n}(u.default.extend({props:{delay:{type:String,default:"0"},duration:{type:String,default:".25"},transform:{type:Array,default:function(){return["translateY(-20px)","translateY(0)"]}}}})),y=b=m([f.b],b)},437:function(e,t,n){"use strict";n(67);t.a={data:function(){return{recoShowModule:!1}},mounted:function(){this.recoShowModule=!0},watch:{$route:function(e,t){var n=this;e.path!==t.path&&(this.recoShowModule=!1,setTimeout((function(){n.recoShowModule=!0}),200))}}}},440:function(e,t,n){"use strict";n(17),n(25),n(37),n(49);var o=n(130),r=(n(226),n(6)),a=(n(445),n(424)),i=n(423),s=Object(o.b)({components:{RecoIcon:a.b},setup:function(e,t){var n=Object(i.a)(),a=Object(o.f)({query:"",focused:!1,focusIndex:0,placeholder:void 0}),s=Object(o.a)((function(){return a.focused&&l.value&&l.value.length})),c=function(e){for(var t in n.$site.locales||{})if("/"!==t&&0===e.path.indexOf(t))return t;return"/"},l=Object(o.a)((function(){var e=a.query.trim().toLowerCase();if(e){for(var t=n.$site.pages,o=n.$site.themeConfig.searchMaxSuggestions,r=n.$localePath,i=function(t){return t&&t.title&&t.title.toLowerCase().indexOf(e)>-1},s=[],l=0;l=o);l++){var u=t[l];if(c(u)===r)if(i(u))s.push(u);else if(u.headers)for(var f=0;f=o);f++){var d=u.headers[f];i(d)&&s.push(Object.assign({},u,{path:u.path+"#"+d.slug,header:d}))}}return s}})),u=Object(o.a)((function(){return(n.$site.themeConfig.nav||[]).length+(n.$site.repo?1:0)<=2}));return Object(r.a)({showSuggestions:s,suggestions:l,alignRight:u,onUp:function(){s.value&&(a.focusIndex>0?a.focusIndex--:a.focusIndex=l.value.length-1)},onDown:function(){s.value&&(a.focusIndex "+e._s(t.header.title))]):e._e()])])})),0):e._e()],1)}),[],!1,null,null,null).exports,u=(n(485),Object(c.a)({},(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-button",on:{click:function(t){return e.$emit("toggle-sidebar")}}},[n("svg",{staticClass:"icon",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",viewBox:"0 0 448 512"}},[n("path",{attrs:{fill:"currentColor",d:"M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"}})])])}),[],!1,null,null,null).exports),f=n(50),d=(n(69),n(38),n(48),n(94),n(131),n(486),n(442),n(96),n(231),n(232),n(233),n(443)),p=n(477),h=Object(o.b)({components:{NavLink:d.a,DropdownTransition:p.a,RecoIcon:a.b},props:{item:{required:!0}},setup:function(e,t){var n=Object(o.g)(!1);return{open:n,toggle:function(){n.value=!n.value}}}}),g=(n(488),Object(c.a)(h,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"dropdown-wrapper",class:{open:e.open}},[n("a",{staticClass:"dropdown-title",on:{click:e.toggle}},[n("span",{staticClass:"title"},[n("reco-icon",{attrs:{icon:""+e.item.icon}}),e._v("\n "+e._s(e.item.text)+"\n ")],1),e._v(" "),n("span",{staticClass:"arrow",class:e.open?"down":"right"})]),e._v(" "),n("DropdownTransition",[n("ul",{directives:[{name:"show",rawName:"v-show",value:e.open,expression:"open"}],staticClass:"nav-dropdown"},e._l(e.item.items,(function(t,o){return n("li",{key:t.link||o,staticClass:"dropdown-item"},["links"===t.type?n("h4",[e._v(e._s(t.text))]):e._e(),e._v(" "),"links"===t.type?n("ul",{staticClass:"dropdown-subitem-wrapper"},e._l(t.items,(function(e){return n("li",{key:e.link,staticClass:"dropdown-subitem"},[n("NavLink",{attrs:{item:e}})],1)})),0):n("NavLink",{attrs:{item:t}})],1)})),0)])],1)}),[],!1,null,null,null).exports),v=n(39),m=Object(o.b)({components:{NavLink:d.a,DropdownLink:g,RecoIcon:a.b},setup:function(e,t){var n=Object(i.a)(),r=Object(o.a)((function(){return n.$themeLocaleConfig.nav||n.$themeConfig.nav||[]})),a=Object(o.a)((function(){var e=n.$site.locales||{};if(e&&Object.keys(e).length>1){var t=n.$page.path,o=n.$router.options.routes,a=n.$themeConfig.locales||{},i={text:n.$themeLocaleConfig.selectText||"Languages",items:Object.keys(e).map((function(r){var i,s=e[r],c=a[r]&&a[r].label||s.lang;return s.lang===n.$lang?i=t:(i=t.replace(n.$localeConfig.path,r),o.some((function(e){return e.path===i}))||(i=r)),{text:c,link:i}}))};return[].concat(Object(f.a)(r.value),[i])}var s=n.$themeConfig.blogConfig||{},c=r.value.some((function(e){return!s.category||e.text===(s.category.text||"分类")})),l=r.value.some((function(e){return!s.tag||e.text===(s.tag.text||"标签")}));if(!c&&Object.hasOwnProperty.call(s,"category")){var u=s.category,d=n.$categories;r.value.splice(parseInt(u.location||2)-1,0,{items:d.list.map((function(e){return e.link=e.path,e.text=e.name,e})),text:u.text||n.$recoLocales.category,type:"links",icon:"reco-category"})}if(!l&&Object.hasOwnProperty.call(s,"tag")){var p=s.tag;r.value.splice(parseInt(p.location||3)-1,0,{link:"/tag/",text:p.text||n.$recoLocales.tag,type:"links",icon:"reco-tag"})}return r.value})),s=Object(o.a)((function(){return(n.nav||[]).map((function(e){return Object.assign(Object(v.j)(e),{items:(e.items||[]).map(v.j)})}))})),c=Object(o.a)((function(){var e=n.$themeConfig.repo;return e?/^https?:/.test(e)?e:"https://github.com/".concat(e):""})),l=Object(o.a)((function(){if(!n.repoLink)return"";if(n.$themeConfig.repoLabel)return n.$themeConfig.repoLabel;for(var e=n.repoLink.match(/^https?:\/\/[^/]+/)[0],t=["GitHub","GitLab","Bitbucket"],o=0;o=18?"dark":"light")}}else w(e)}var C={name:"ModeOptions",data:function(){return{modeOptions:[{mode:"dark",title:"dark"},{mode:"auto",title:"auto"},{mode:"light",title:"light"}],currentMode:"auto"}},mounted:function(){this.currentMode=localStorage.getItem("mode")||this.$themeConfig.mode||"auto";var e=this;window.matchMedia("(prefers-color-scheme: dark)").addListener((function(){"auto"===e.$data.currentMode&&O(e.$data.currentMode)})),window.matchMedia("(prefers-color-scheme: light)").addListener((function(){"auto"===e.$data.currentMode&&O(e.$data.currentMode)})),O(this.currentMode)},methods:{selectMode:function(e){e!==this.currentMode&&(this.currentMode=e,O(e),localStorage.setItem("mode",e))},getClass:function(e){return e!==this.currentMode?e:"".concat(e," active")}}},x=(n(491),Object(c.a)(C,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"mode-options"},[n("h4",{staticClass:"title"},[e._v("Choose mode")]),e._v(" "),n("ul",{staticClass:"color-mode-options"},e._l(e.modeOptions,(function(t,o){return n("li",{key:o,class:e.getClass(t.mode),on:{click:function(n){return e.selectMode(t.mode)}}},[e._v(e._s(t.title))])})),0)])}),[],!1,null,null,null).exports),$={name:"UserSettings",directives:{"click-outside":_.a},components:{ModePicker:x,RecoIcon:a.b,ModuleTransition:a.a},data:function(){return{showMenu:!1}},mounted:function(){var e=this.$themeConfig.mode||"auto";!1===this.$themeConfig.modePicker&&("auto"===e&&(window.matchMedia("(prefers-color-scheme: dark)").addListener((function(){O(e)})),window.matchMedia("(prefers-color-scheme: light)").addListener((function(){O(e)}))),O(e))},methods:{hideMenu:function(){this.showMenu=!1}}},j=(n(492),Object(c.a)($,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return!1!==e.$themeConfig.modePicker?n("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hideMenu,expression:"hideMenu"}],staticClass:"color-picker"},[n("a",{staticClass:"color-button",on:{click:function(t){t.preventDefault(),e.showMenu=!e.showMenu}}},[n("reco-icon",{attrs:{icon:"reco-color"}})],1),e._v(" "),n("ModuleTransition",{attrs:{transform:["translate(-50%, 0)","translate(-50%, -10px)"]}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showMenu,expression:"showMenu"}],staticClass:"color-picker-menu"},[n("ModePicker")],1)])],1):e._e()}),[],!1,null,null,null).exports),S=Object(o.b)({components:{SidebarButton:u,NavLinks:b,SearchBox:l,AlgoliaSearchBox:{},Mode:j},setup:function(e,t){var n=Object(i.a)(),r=Object(o.g)(null),a=Object(o.a)((function(){return n.$themeLocaleConfig.algolia||n.$themeConfig.algolia||{}})),s=Object(o.a)((function(){a.value&&a.value.apiKey&&a.value.indexName}));function c(e,t){return e.ownerDocument.defaultView.getComputedStyle(e,null)[t]}return Object(o.d)((function(){var e=parseInt(c(n.$el,"paddingLeft"))+parseInt(c(n.$el,"paddingRight")),t=function(){document.documentElement.clientWidth<719?r.value=null:r.value=n.$el.offsetWidth-e-(n.$refs.siteName&&n.$refs.siteName.offsetWidth||0)};t(),window.addEventListener("resize",t,!1)})),{linksWrapMaxWidth:r,algolia:a,isAlgoliaSearch:s,css:c}}}),I=(n(493),Object(c.a)(S,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("header",{staticClass:"navbar"},[n("SidebarButton",{on:{"toggle-sidebar":function(t){return e.$emit("toggle-sidebar")}}}),e._v(" "),n("router-link",{staticClass:"home-link",attrs:{to:e.$localePath}},[e.$themeConfig.logo?n("img",{staticClass:"logo",attrs:{src:e.$withBase(e.$themeConfig.logo),alt:e.$siteTitle}}):e._e(),e._v(" "),e.$siteTitle?n("span",{ref:"siteName",staticClass:"site-name"},[e._v(e._s(e.$siteTitle))]):e._e()]),e._v(" "),n("div",{staticClass:"links",style:e.linksWrapMaxWidth?{"max-width":e.linksWrapMaxWidth+"px"}:{}},[n("Mode"),e._v(" "),e.isAlgoliaSearch?n("AlgoliaSearchBox",{attrs:{options:e.algolia}}):!1!==e.$themeConfig.search&&!1!==e.$frontmatter.search?n("SearchBox"):e._e(),e._v(" "),n("NavLinks",{staticClass:"can-hide"})],1)],1)}),[],!1,null,null,null).exports),L=n(475),M=Object(o.b)({name:"Sidebar",components:{SidebarLinks:L.default,NavLinks:b},props:["items"]}),T=(n(496),Object(c.a)(M,(function(){var e=this.$createElement,t=this._self._c||e;return t("aside",{staticClass:"sidebar"},[this._t("top"),this._v(" "),t("NavLinks"),this._v(" "),t("SidebarLinks",{attrs:{depth:0,items:this.items}}),this._v(" "),this._t("bottom")],2)}),[],!1,null,null,null).exports),P=n(476),E=(n(67),n(458)),B=n.n(E),N=Object(o.b)({name:"Password",components:{ModuleTransition:a.a,RecoIcon:a.b},props:{isPage:{type:Boolean,default:!1}},setup:function(e,t){var n=Object(i.a)(),r=(new Date).getFullYear(),a=Object(o.g)(""),s=Object(o.g)("Konck! Knock!"),c=Object(o.a)((function(){var e;return null==n||null===(e=n.$parent)||void 0===e?void 0:e.recoShowModule})),l=Object(o.h)(e).isPage;return{warningText:s,year:r,key:a,recoShowModule:c,inter:function(){var e=B()(a.value.trim()),t="pageKey".concat(window.location.pathname),o=l.value?t:"key";if(sessionStorage.setItem(o,e),l.value?function(){var e=n.$frontmatter.keys.map((function(e){return e.toLowerCase()})),t="pageKey".concat(window.location.pathname);return e&&e.indexOf(sessionStorage.getItem(t))>-1}():n.$themeConfig.keyPage.keys.map((function(e){return e.toLowerCase()})).indexOf(sessionStorage.getItem("key"))>-1){s.value="Key Success";var r=document.getElementById("box").style.width;n.$refs.passwordBtn.style.width="".concat(r-2,"px"),n.$refs.passwordBtn.style.opacity=1,setTimeout((function(){window.location.reload()}),800)}else s.value="Key Error"},inputFocus:function(){s.value="Input Your Key"},inputBlur:function(){s.value="Konck! Knock!"}}}}),A=(n(500),Object(c.a)(N,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"password-shadow"},[n("ModuleTransition",[n("h3",{directives:[{name:"show",rawName:"v-show",value:e.recoShowModule,expression:"recoShowModule"}],staticClass:"title"},[e._v(e._s(e.isPage?e.$frontmatter.title:e.$site.title||e.$localeConfig.title))])]),e._v(" "),n("ModuleTransition",{attrs:{delay:"0.08"}},[e.recoShowModule&&!e.isPage?n("p",{staticClass:"description"},[e._v(e._s(e.$site.description||e.$localeConfig.description))]):e._e()]),e._v(" "),n("ModuleTransition",{attrs:{delay:"0.16"}},[n("label",{directives:[{name:"show",rawName:"v-show",value:e.recoShowModule,expression:"recoShowModule"}],staticClass:"inputBox",attrs:{id:"box"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.key,expression:"key"}],attrs:{type:"password"},domProps:{value:e.key},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.inter(t)},focus:e.inputFocus,blur:e.inputBlur,input:function(t){t.target.composing||(e.key=t.target.value)}}}),e._v(" "),n("span",[e._v(e._s(e.warningText))]),e._v(" "),n("button",{ref:"passwordBtn",on:{click:e.inter}},[e._v("OK")])])]),e._v(" "),n("ModuleTransition",{attrs:{delay:"0.24"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.recoShowModule,expression:"recoShowModule"}],staticClass:"footer"},[n("span",[n("reco-icon",{attrs:{icon:"reco-theme"}}),e._v(" "),n("a",{attrs:{target:"blank",href:"https://vuepress-theme-reco.recoluan.com"}},[e._v("vuePress-theme-reco")])],1),e._v(" "),n("span",[n("reco-icon",{attrs:{icon:"reco-copyright"}}),e._v(" "),n("a",[e.$themeConfig.author?n("span",[e._v(e._s(e.$themeConfig.author))]):e._e(),e._v("\n   \n "),e.$themeConfig.startYear&&e.$themeConfig.startYear!=e.year?n("span",[e._v(e._s(e.$themeConfig.startYear)+" - ")]):e._e(),e._v("\n "+e._s(e.year)+"\n ")])],1)])])],1)}),[],!1,null,"25ba6db2",null).exports),H=n(501),K=Object(o.b)({components:{Sidebar:T,Navbar:I,Password:A,PersonalInfo:P.a},props:{sidebar:{type:Boolean,default:!0},sidebarItems:{type:Array,default:function(){return[]}},showModule:{type:Boolean,default:!1}},setup:function(e,t){var n=Object(i.a)(),r=Object(o.g)(!1),a=Object(o.g)(!0),s=Object(o.g)(!0),c=Object(o.g)(!0),l=Object(o.a)((function(){return e.sidebarItems.length>0})),u=Object(o.a)((function(){return n.$themeConfig.keyPage&&!0===n.$themeConfig.keyPage.absoluteEncryption})),f=Object(o.a)((function(){var e=n.$site.themeConfig;return!1!==n.$page.frontmatter.navbar&&!1!==e.navbar&&(n.$title||e.logo||e.repo||e.nav||n.$themeLocaleConfig.nav)})),d=Object(o.a)((function(){var e={"no-navbar":!f.value,"sidebar-open":r.value,"no-sidebar":!l.value},t=(n.$frontmatter||{}).pageClass;return t&&(e[t]=!0),e})),p=function(){var e=n.$themeConfig.keyPage;if(e&&e.keys&&0!==e.keys.length){var t=e.keys;t=t.map((function(e){return e.toLowerCase()})),a.value=t&&t.indexOf(sessionStorage.getItem("key"))>-1}else a.value=!0},h=function(){var e=n.$frontmatter.keys;e&&0!==e.length?(e=e.map((function(e){return e.toLowerCase()})),s.value=e.indexOf(sessionStorage.getItem("pageKey".concat(window.location.pathname)))>-1):s.value=!0},g=Object(o.h)(e).showModule,v=Object(o.a)((function(){return!!c.value||g.value}));return Object(o.d)((function(){var e;n.$router.afterEach((function(){r.value=!1})),p(),h(),e=n.$frontmatter.home&&null==sessionStorage.getItem("firstLoad")?1e3:0,Object(H.setTimeout)((function(){c.value=!1,null==sessionStorage.getItem("firstLoad")&&sessionStorage.setItem("firstLoad",!1)}),e)})),{isSidebarOpen:r,absoluteEncryption:u,shouldShowNavbar:f,shouldShowSidebar:l,pageClasses:d,hasKey:p,hasPageKey:h,isHasKey:a,isHasPageKey:s,toggleSidebar:function(e){r.value="boolean"==typeof e?e:!r.value},firstLoad:c,recoShowModule:v}},watch:{$frontmatter:function(e,t){this.hasKey(),this.hasPageKey()}}}),D=(n(503),Object(c.a)(K,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"theme-container",class:e.pageClasses},[e.absoluteEncryption?n("div",[n("transition",{attrs:{name:"fade"}},[e.isHasKey?n("div",[e.shouldShowNavbar?n("Navbar",{on:{"toggle-sidebar":e.toggleSidebar}}):e._e(),e._v(" "),n("div",{staticClass:"sidebar-mask",on:{click:function(t){return e.toggleSidebar(!1)}}}),e._v(" "),n("Sidebar",{attrs:{items:e.sidebarItems},on:{"toggle-sidebar":e.toggleSidebar}},[n("PersonalInfo",{attrs:{slot:"top"},slot:"top"}),e._v(" "),e._t("sidebar-bottom",null,{slot:"bottom"})],2),e._v(" "),e.isHasPageKey?e._t("default"):n("Password",{attrs:{isPage:!0}})],2):n("Password")],1)],1):n("div",[n("transition",{attrs:{name:"fade"}},[n("Password",{directives:[{name:"show",rawName:"v-show",value:!e.firstLoad&&!e.isHasKey,expression:"!firstLoad && !isHasKey"}],key:"out",staticClass:"password-wrapper-out"})],1),e._v(" "),n("div",{class:{hide:e.firstLoad||!e.isHasKey}},[e.shouldShowNavbar?n("Navbar",{on:{"toggle-sidebar":e.toggleSidebar}}):e._e(),e._v(" "),n("div",{staticClass:"sidebar-mask",on:{click:function(t){return e.toggleSidebar(!1)}}}),e._v(" "),n("Sidebar",{attrs:{items:e.sidebarItems},on:{"toggle-sidebar":e.toggleSidebar}},[n("PersonalInfo",{attrs:{slot:"top"},slot:"top"}),e._v(" "),e._t("sidebar-bottom",null,{slot:"bottom"})],2),e._v(" "),n("Password",{directives:[{name:"show",rawName:"v-show",value:!e.isHasPageKey,expression:"!isHasPageKey"}],key:"in",staticClass:"password-wrapper-in",attrs:{isPage:!0}}),e._v(" "),n("div",{class:{hide:!e.isHasPageKey}},[e._t("default")],2)],1)],1)])}),[],!1,null,"130b300a",null));t.a=D.exports},442:function(e,t,n){"use strict";var o=n(1),r=n(482);o({target:"String",proto:!0,forced:n(483)("link")},{link:function(e){return r(this,"a","href",e)}})},443:function(e,t,n){"use strict";n(442),n(94),n(69);var o=n(130),r=n(39),a=n(424),i=n(423),s=Object(o.b)({components:{RecoIcon:a.b},props:{item:{required:!0}},setup:function(e,t){var n=Object(i.a)(),a=Object(o.h)(e).item,s=Object(o.a)((function(){return Object(r.d)(a.value.link)})),c=Object(o.a)((function(){return n.$site.locales?Object.keys(n.$site.locales).some((function(e){return e===s.value})):"/"===s.value}));return{link:s,exact:c,isExternal:r.f,isMailto:r.g,isTel:r.h}}}),c=n(9),l=Object(c.a)(s,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isExternal(e.link)?n("a",{staticClass:"nav-link external",attrs:{href:e.link,target:e.isMailto(e.link)||e.isTel(e.link)?null:"_blank",rel:e.isMailto(e.link)||e.isTel(e.link)?null:"noopener noreferrer"}},[n("reco-icon",{attrs:{icon:""+e.item.icon}}),e._v("\n "+e._s(e.item.text)+"\n "),n("OutboundLink")],1):n("router-link",{staticClass:"nav-link",attrs:{to:e.link,exact:e.exact}},[n("reco-icon",{attrs:{icon:""+e.item.icon}}),e._v("\n "+e._s(e.item.text)+"\n")],1)}),[],!1,null,null,null);t.a=l.exports},445:function(e,t,n){"use strict";var o=n(1),r=n(135).trim;o({target:"String",proto:!0,forced:n(479)("trim")},{trim:function(){return r(this)}})},446:function(e,t,n){},447:function(e,t,n){},448:function(e,t,n){},449:function(e,t,n){},450:function(e,t,n){},451:function(e,t,n){},452:function(e,t,n){},453:function(e,t,n){},454:function(e,t,n){},455:function(e,t,n){},456:function(e,t,n){},457:function(e,t,n){},458:function(e,t,n){var o,r,a,i,s;o=n(498),r=n(459).utf8,a=n(499),i=n(459).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?i.stringToBytes(e):r.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var n=o.bytesToWords(e),c=8*e.length,l=1732584193,u=-271733879,f=-1732584194,d=271733878,p=0;p>>24)|4278255360&(n[p]<<24|n[p]>>>8);n[c>>>5]|=128<>>9<<4)]=c;var h=s._ff,g=s._gg,v=s._hh,m=s._ii;for(p=0;p>>0,u=u+y>>>0,f=f+_>>>0,d=d+k>>>0}return o.endian([l,u,f,d])})._ff=function(e,t,n,o,r,a,i){var s=e+(t&n|~t&o)+(r>>>0)+i;return(s<>>32-a)+t},s._gg=function(e,t,n,o,r,a,i){var s=e+(t&o|n&~o)+(r>>>0)+i;return(s<>>32-a)+t},s._hh=function(e,t,n,o,r,a,i){var s=e+(t^n^o)+(r>>>0)+i;return(s<>>32-a)+t},s._ii=function(e,t,n,o,r,a,i){var s=e+(n^(t|~o))+(r>>>0)+i;return(s<>>32-a)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var n=o.wordsToBytes(s(e,t));return t&&t.asBytes?n:t&&t.asString?i.bytesToString(n):o.bytesToHex(n)}},459:function(e,t){var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n-1&&(s.value=e)},l=function(){var e=[].slice.call(document.querySelectorAll(".header-anchor")).filter((function(e){return-1!=decodeURIComponent(n.$route.fullPath).indexOf(decodeURIComponent(e.hash))}));null==e||e.length<1||null==e[0].offsetTop||setTimeout((function(){window.scrollTo(0,e[0].offsetTop+160)}),100)},u=function(){var e=document.getElementsByClassName("sidebar")[0],t=document.getElementsByClassName("active sidebar-link")[1];if(null!=t&&null!=t&&null!=t.offsetTop||(t=document.getElementsByClassName("active sidebar-link")[0]),null!=t&&null!=t&&null!=t.offsetTop){var n=e.clientHeight||window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,o=t.offsetTop,r=t.offsetTop+t.offsetHeight,a=e.scrollTop;r<=n+a||(e.scrollTop=r+5-n),o>=a||(e.scrollTop=o-5)}};return c(),Object(o.d)((function(){!function(){var e=decodeURIComponent(n.$route.fullPath);if(e&&""!=e)for(var t=[].slice.call(document.querySelectorAll(".sidebar-link")),o=0;o"+i+""}},483:function(e,t,n){var o=n(2);e.exports=function(e){return o((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},484:function(e,t,n){"use strict";n(446)},485:function(e,t,n){"use strict";n(447)},486:function(e,t,n){"use strict";var o=n(1),r=n(132),a=n(51),i=n(14),s=n(12),c=n(133),l=n(70),u=n(71)("splice"),f=Math.max,d=Math.min;o({target:"Array",proto:!0,forced:!u},{splice:function(e,t){var n,o,u,p,h,g,v=s(this),m=i(v.length),b=r(e,m),y=arguments.length;if(0===y?n=o=0:1===y?(n=0,o=m-b):(n=y-2,o=d(f(a(t),0),m-b)),m+n-o>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(u=c(v,o),p=0;pm-o+n;p--)delete v[p-1]}else if(n>o)for(p=m-o;p>b;p--)g=p+n-1,(h=p+o-1)in v?v[g]=v[h]:delete v[g];for(p=0;p0&&n.unshift(t.target),e.contains(t.target)||function(e,t){if(!e||!t)return!1;for(var n=0,o=t.length;n>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&o.rotl(e,8)|4278255360&o.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,o=0;n>>5]|=e[n]<<24-o%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-a)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],o=0,r=0;o>>6-2*r);return t}},e.exports=o},499:function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ +e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},500:function(e,t,n){"use strict";n(460)},501:function(e,t,n){var o="undefined"!=typeof global&&global||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(r.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new a(r.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(502),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof global&&global.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof global&&global.clearImmediate||this&&this.clearImmediate},502:function(e,t){!function(e,t){"use strict";if(!e.setImmediate){var n,o,r,a,i,s=1,c={},l=!1,u=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?n=function(e){process.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(o=u.documentElement,n=function(e){var t=u.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),n=function(t){e.postMessage(a+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),o=0;o")])]),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\ndata: { isActive: true, hasError: false }\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br")])]),n("ul",[n("li",[t._v("数组语法:")])]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[n("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("v-bind:")]),t._v("class")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("[isActive ? activeClass : "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v(", errorClass]"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\ndata: { activeClass: 'active', errorClass: 'text-danger' }\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br")])]),n("p",[t._v("Style 也可以通过对象语法和数组语法进行动态绑定:")]),t._v(" "),n("ul",[n("li",[t._v("对象语法:")])]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[n("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("v-bind:")]),t._v("style")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("{ color: activeColor, fontSize: fontSize + "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v("px"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("'")]),t._v(" }"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\ndata: { activeColor: 'red', fontSize: 30 }\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br")])]),n("ul",[n("li",[t._v("数组语法:")])]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[n("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("v-bind:")]),t._v("style")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("[styleColor, styleSize]"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n\ndata: { styleColor: { color: 'red' }, styleSize:{ fontSize:'23px' } }\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br")])]),n("h2",{attrs:{id:"_4、怎样理解-vue-的单向数据流"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4、怎样理解-vue-的单向数据流"}},[t._v("#")]),t._v(" 4、怎样理解 Vue 的单向数据流?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("所有的 prop 都使得其父子 prop 之间形成了一个单向下行绑定:父级 prop 的更新会向下流动到子组件中,但是反过来不行。这样会防止从子组件意外改变父子组件的状态,从而导致你的应用的数据流向难以理解。")]),t._v(" "),n("p",[t._v("额外的,每次父级组件发生更新时,子组件中所有的 prop 都会刷新为最新的值。这意味着你不应该在一个子组件内部改变 prop。如果这样子做,Vue 会在浏览器的控制台发出警告。子组件想修改时,只能通过$emit 派发一个自定义事件,父组件接收到后,由父组件修改。")]),t._v(" "),n("p",[t._v("有两种常见的试图改变一个 prop 的情形 :")]),t._v(" "),n("ul",[n("li",[t._v("这个 prop 用来传递一个初始值;这个子组件接下来希望将其作为一个本地的 prop 数据来使用。 在这种情况下,最好定义一个本地的 data 属性并将这个 prop 用作其初始值:")])]),t._v(" "),n("div",{staticClass:"language- line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("props: ['initialCounter'],\ndata: function () {\n return {\n counter: this.initialCounter\n }\n}\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br")])]),n("ul",[n("li",[t._v("这个 prop 以一种原始的值传入且需要进行转换。 在这种情况下,最好使用这个 prop 的值来定义一个计算属性")])]),t._v(" "),n("div",{staticClass:"language- line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("props: ['size'],\ncomputed: {\n normalizedSize: function () {\n return this.size.trim().toLowerCase()\n }\n}\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br")])]),n("h2",{attrs:{id:"_5、computed-和-watch-的区别和运用的场景"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_5、computed-和-watch-的区别和运用的场景"}},[t._v("#")]),t._v(" 5、computed 和 watch 的区别和运用的场景?")]),t._v(" "),n("hr"),t._v(" "),n("p",[n("b",[t._v("computed:")]),t._v("是计算属性,以来其它属性值,并且 computed 的值有缓存,只有它以来的属性值发生改变,下一次获取 computed 的值时才会重新计算 computed 的值;")]),t._v(" "),n("p",[n("b",[t._v("watch:")]),t._v("更多的是「观察」的作用,类似于某些数据的监听回调,每当监听的数据变化时都会执行回调进行后续的操作;")]),t._v(" "),n("p",[n("b",[t._v("运用场景:")])]),t._v(" "),n("ul",[n("li",[t._v("当我们需要进行数值计算,并且依赖于其它数据时,应该使用 computed,因为可以利用 computed 的缓存特性,避免每次获取值时,都要重新计算;")]),t._v(" "),n("li",[t._v("当我们需要在数据变化时执行异步或开销较大的操作时,应该使用 watch,使用 watch 选项允许我们执行异步操作(访问一个 API),限制我们执行该操作的频率,并在我们得到最终结果前,设置中间状态。这些都是计算属性无法做到的。")])]),t._v(" "),n("h2",{attrs:{id:"_6、直接给一个数组赋值-vue-能监测到变化吗"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_6、直接给一个数组赋值-vue-能监测到变化吗"}},[t._v("#")]),t._v(" 6、直接给一个数组赋值,Vue 能监测到变化吗?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("由于 JavaScript 的限制,Vue 不能监测到以下数组的变动:")]),t._v(" "),n("ul",[n("li",[t._v("当你利用索引直接设置一个数组项时,例如:"),n("code",[t._v("vm.items[indexOfItem]=newValue")])]),t._v(" "),n("li",[t._v("当你修改数组长度时,例如:"),n("code",[t._v("vm.items.length = newLength")])])]),t._v(" "),n("p",[t._v("为了解决第一个问题,Vue 提供了以下操作方法:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Vue.set")]),t._v("\nVue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("set")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("vm"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("items"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" indexOfItem"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" newValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//vm.$set")]),t._v("\nvm"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$set")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("vm"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("items"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" indexOfItem"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" newValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Array.prototype.splice")]),t._v("\nvm"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("items"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("splice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("indexOfItem"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" newValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br")])]),n("p",[t._v("为了解决第二个问题,Vue 提供了以下操作方法:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Array.prototype.splice")]),t._v("\nvm"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("items"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("splice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("newLength"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br")])]),n("h2",{attrs:{id:"_7、谈谈你对-vue-生命周期的理解"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_7、谈谈你对-vue-生命周期的理解"}},[t._v("#")]),t._v(" 7、谈谈你对 Vue 生命周期的理解?")]),t._v(" "),n("hr"),t._v(" "),n("h3",{attrs:{id:"_1-生命周期是什么"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-生命周期是什么"}},[t._v("#")]),t._v(" (1)生命周期是什么?")]),t._v(" "),n("p",[t._v("Vue 实例有一个完整的生命周期,也就是从开始创建、初始化数据、编译模板、挂载 DOM->渲染、更新->渲染、卸载等一些列过程,我们称这是 Vue 的生命周期。")]),t._v(" "),n("h3",{attrs:{id:"_2-各个生命周期的作用"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-各个生命周期的作用"}},[t._v("#")]),t._v(" (2)各个生命周期的作用?")]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",{staticStyle:{"text-align":"center"}},[t._v("生命周期")]),t._v(" "),n("th",{staticStyle:{"text-align":"left"}},[t._v("描述")])])]),t._v(" "),n("tbody",[n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("beforeCreate")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("组件实例被创建之初,组件的属性生效之前")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("created")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("组件实例已经完全创建,属性也绑定,但真实 DOM 还没有生成,$el 还不可用")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("beforeMount")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("在挂载开始之前被调用:相关的 render 函数首次被调用")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("mounted")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("el 被新创建的 vm.$el 替换,并挂载到实例上去之后调用该钩子")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("beforeUpdate")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("组件数据更新之前被调用,发生在虚拟 DOM 打补丁之前")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("update")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("组件数据更新之后")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("activited")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("keep-alive 专属,组件被激活时调用")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("deactivated")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("keep-alive 专属,组件被销毁时调用")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("beforeDestory")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("组件销毁前调用")])]),t._v(" "),n("tr",[n("td",{staticStyle:{"text-align":"center"}},[t._v("destoryed")]),t._v(" "),n("td",{staticStyle:{"text-align":"left"}},[t._v("组件销毁后调用")])])])]),t._v(" "),n("h3",{attrs:{id:"_3-生命周期示意图"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-生命周期示意图"}},[t._v("#")]),t._v(" (3)生命周期示意图")]),t._v(" "),n("p",[n("img",{attrs:{src:a(541),alt:"Vue生命周期示意图",title:"Vue生命周期示意图"}})]),t._v(" "),n("h2",{attrs:{id:"_8、vue-的父组件和子组件生命周期钩子函数执行顺序"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_8、vue-的父组件和子组件生命周期钩子函数执行顺序"}},[t._v("#")]),t._v(" 8、Vue 的父组件和子组件生命周期钩子函数执行顺序?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("Vue 的父组件和子组件生命周期钩子函数执行顺序可以归类为以下 4 部分:")]),t._v(" "),n("ul",[n("li",[t._v("加载渲染过程")])]),t._v(" "),n("p",[t._v("父 beforeCreate -> 父 created -> 父 beforeMount -> 子 beforeCreate -> 子 created -> 子 beforeMount -> 子 mounted -> 父 mounted")]),t._v(" "),n("ul",[n("li",[t._v("子组件更新过程")])]),t._v(" "),n("p",[t._v("父 beforeUpdate -> 子 beforeUpdate -> 子 updated -> 父 updated")]),t._v(" "),n("ul",[n("li",[t._v("父组件更新过程")])]),t._v(" "),n("p",[t._v("父 beforeUpdate -> 父 updated")]),t._v(" "),n("ul",[n("li",[t._v("销毁过程")])]),t._v(" "),n("p",[t._v("父 beforeDestroy -> 子 beforeDestroy -> 子 destroyed -> 父 destroyed")]),t._v(" "),n("h2",{attrs:{id:"_9、在哪个生命周期内调用异步请求"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_9、在哪个生命周期内调用异步请求"}},[t._v("#")]),t._v(" 9、在哪个生命周期内调用异步请求?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("可以在钩子函数 created、beforeMount、mounted 中进行调用,因为在这三个钩子函数中,data 已经创建,可以将服务端端返回的数据进行赋值。但是本人推荐在 created 钩子函数中调用异步请求,因为在 created 钩子函数中调用异步请求有以下优点:")]),t._v(" "),n("ul",[n("li",[t._v("能更快获取到服务端数据,减少页面 loading 时间;")]),t._v(" "),n("li",[t._v("SSR 不支持 beforeMount、mounted 钩子函数,所以放在 created 中有助于一致性;")])]),t._v(" "),n("h2",{attrs:{id:"_10、在什么阶段才能访问操作-dom"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_10、在什么阶段才能访问操作-dom"}},[t._v("#")]),t._v(" 10、在什么阶段才能访问操作 DOM?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("在钩子函数 mounted 被调用前,Vue 已经将编译好的模板挂载到页面上,所以在 mounted 中可以访问操作 DOM。")]),t._v(" "),n("h2",{attrs:{id:"_11、父组件可以监听到子组件的生命周期吗"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_11、父组件可以监听到子组件的生命周期吗"}},[t._v("#")]),t._v(" 11、父组件可以监听到子组件的生命周期吗?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("比如有父组件 Parent 和子组件 Child,如果父组件监听到子组件挂载 mounted 就做一些逻辑处理,可以通过以下写法实现:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Parent.vue")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Child @mounted"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"doSomething"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Child.vue")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("mounted")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$emit")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"mounted"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br")])]),n("p",[t._v("以上需要手动通过 $emit 触发父组件的事件,更简单的方式可以在父组件引用子组件时通过 @hook 来监听即可,如下所示:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Parent.vue")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("Child @hook"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("mounted"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"doSomething"')]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("Child"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("doSomething")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'父组件监听到 mounted 钩子函数 ...'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Child.vue")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("mounted")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'子组件触发 mounted 钩子函数 ...'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 以上输出顺序为:")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 子组件触发 mounted 钩子函数 ...")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 父组件监听到 mounted 钩子函数 ...")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br")])]),n("p",[t._v("当然 @hook 方法不仅仅是可以监听 mounted,其它的生命周期事件,例如:created,updated 等都可以监听。")]),t._v(" "),n("h2",{attrs:{id:"_12、谈谈你对-keep-alive-的了解"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_12、谈谈你对-keep-alive-的了解"}},[t._v("#")]),t._v(" 12、谈谈你对 keep-alive 的了解?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("keep-alive 是 Vue 内置的一个组件,可以使被包含的组件保留状态,避免重新渲染 ,其有以下特性:")]),t._v(" "),n("ul",[n("li",[t._v("一般结合路由和动态组件一起使用,用于缓存组件;")]),t._v(" "),n("li",[t._v("提供 include 和 exclude 属性,两者都支持字符串或正则表达式, include 表示只有名称匹配的组件会被缓存,exclude 表示任何名称匹配的组件都不会被缓存 ,其中 exclude 的优先级比 include 高;")]),t._v(" "),n("li",[t._v("对应两个钩子函数 activated 和 deactivated ,当组件被激活时,触发钩子函数 activated,当组件被移除时,触发钩子函数 deactivated。")])]),t._v(" "),n("h2",{attrs:{id:"_13、组件中-data-为什么是一个函数"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_13、组件中-data-为什么是一个函数"}},[t._v("#")]),t._v(" 13、组件中 data 为什么是一个函数?")]),t._v(" "),n("hr"),t._v(" "),n("blockquote",[n("p",[t._v("为什么组件中的 data 必须是一个函数,然后 return 一个对象,而 new Vue 实例里,data 可以直接是一个对象?")])]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// data")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("data")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("message")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"子组件"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("childName")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("name\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// new Vue")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Vue")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("el")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'#app'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n router"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("template")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("''")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("components")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("App"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br")])]),n("p",[t._v("因为组件是用来复用的,且 JS 里对象是引用关系,如果组件中 data 是一个对象,那么这样作用域没有隔离,子组件中的 data 属性值会相互影响,如果组件中 data 选项是一个函数,那么每个实例可以维护一份被返回对象的独立的拷贝,组件实例之间的 data 属性值不会互相影响;而 new Vue 的实例,是不会被复用的,因此不存在引用对象的问题。")]),t._v(" "),n("h2",{attrs:{id:"_14、v-model-的原理"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_14、v-model-的原理"}},[t._v("#")]),t._v(" 14、v-model 的原理?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("我们在 vue 项目中主要使用 v-model 指令在表单 input、textarea、select 等元素上创建双向数据绑定,我们知道 v-model 本质上不过是语法糖,v-model 在内部为不同的输入元素使用不同的属性并抛出不同的事件:")]),t._v(" "),n("ul",[n("li",[t._v("text 和 textarea 元素使用 value 属性和 input 事件;")]),t._v(" "),n("li",[t._v("checkbox 和 radio 使用 checked 属性和 change 事件;")]),t._v(" "),n("li",[t._v("select 字段将 value 作为 prop 并将 change 作为事件。")])]),t._v(" "),n("p",[t._v("以 input 表单元素为例:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("input v"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("model"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'something'")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n相当于\n\n"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("input v"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("bind"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"something"')]),t._v(" v"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("on"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("input"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"something = $event.target.value"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br")])]),n("p",[t._v("如果在自定义组件中,v-model 默认会利用名为 value 的 prop 和名为 input 的事件,如下所示:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("父组件:\n"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("ModelChild v"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("model"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"message"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("ModelChild"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n子组件:\n"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("div"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("div"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("props")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("value")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" String\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("methods")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("test1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$emit")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'input'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'小红'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br")])]),n("h2",{attrs:{id:"_15、vue-组件间通信有哪几种方式"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_15、vue-组件间通信有哪几种方式"}},[t._v("#")]),t._v(" 15、Vue 组件间通信有哪几种方式?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("Vue 组件间通信只要指以下 3 类通信:父子组件通信、隔代组件通信、兄弟组件通信,下面我们分别介绍每种通信方式且会说明此种方法可适用于哪类组件间通信。")]),t._v(" "),n("h3",{attrs:{id:"_1-props-emit-适用-父子组件通信"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-props-emit-适用-父子组件通信"}},[t._v("#")]),t._v(" (1)"),n("code",[t._v("props")]),t._v(" / "),n("code",[t._v("$emit")]),t._v(" 适用 父子组件通信")]),t._v(" "),n("h3",{attrs:{id:"_2-ref-与-parent-children-适用-父子组件通信"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-ref-与-parent-children-适用-父子组件通信"}},[t._v("#")]),t._v(" (2)"),n("code",[t._v("ref")]),t._v(" 与 "),n("code",[t._v("$parent")]),t._v(" / "),n("code",[t._v("$children")]),t._v(" 适用 父子组件通信")]),t._v(" "),n("ul",[n("li",[n("code",[t._v("ref")]),t._v(":如果在普通的 DOM 元素上使用,引用指向的就是 DOM 元素;如果用在子组件上,引用就指向组件实例")]),t._v(" "),n("li",[n("code",[t._v("$parent")]),t._v(" / "),n("code",[t._v("$children")]),t._v(":访问父 / 子实例")])]),t._v(" "),n("h3",{attrs:{id:"_3-eventbus-emit-on-适用于-父子、隔代、兄弟组件通信"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-eventbus-emit-on-适用于-父子、隔代、兄弟组件通信"}},[t._v("#")]),t._v(" (3)"),n("code",[t._v("EventBus")]),t._v(" ("),n("code",[t._v("$emit")]),t._v(" / "),n("code",[t._v("$on")]),t._v(") 适用于 父子、隔代、兄弟组件通信")]),t._v(" "),n("p",[t._v("这种方法通过一个空的 Vue 实例作为中央事件总线(事件中心),用它来触发事件和监听事件,从而实现任何组件间的通信,包括父子、隔代、兄弟组件。")]),t._v(" "),n("h3",{attrs:{id:"_4-attrs-listeners-适用于-隔代组件通信"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4-attrs-listeners-适用于-隔代组件通信"}},[t._v("#")]),t._v(" (4)"),n("code",[t._v("$attrs")]),t._v("/"),n("code",[t._v("$listeners")]),t._v(" 适用于 隔代组件通信")]),t._v(" "),n("ul",[n("li",[n("code",[t._v("$attrs")]),t._v(':包含了父作用域中不被 prop 所识别 (且获取) 的特性绑定 ( class 和 style 除外 )。当一个组件没有声明任何 prop 时,这里会包含所有父作用域的绑定 ( class 和 style 除外 ),并且可以通过 v-bind="$attrs" 传入内部组件。通常配合 inheritAttrs 选项一起使用。')]),t._v(" "),n("li",[n("code",[t._v("$listeners")]),t._v(':包含了父作用域中的 (不含 .native 修饰器的) v-on 事件监听器。它可以通过 v-on="$listeners" 传入内部组件')])]),t._v(" "),n("h3",{attrs:{id:"_5-provide-inject-适用于-隔代组件通信"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_5-provide-inject-适用于-隔代组件通信"}},[t._v("#")]),t._v(" (5)"),n("code",[t._v("provide")]),t._v(" / "),n("code",[t._v("inject")]),t._v(" 适用于 隔代组件通信")]),t._v(" "),n("p",[t._v("祖先组件中通过 provider 来提供变量,然后在子孙组件中通过 inject 来注入变量。 provide / inject API 主要解决了跨级组件间的通信问题,不过它的使用场景,主要是子组件获取上级组件的状态,跨级组件间建立了一种主动提供与依赖注入的关系。")]),t._v(" "),n("h3",{attrs:{id:"_6-vuex-适用于-父子、隔代、兄弟组件通信"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_6-vuex-适用于-父子、隔代、兄弟组件通信"}},[t._v("#")]),t._v(" (6)"),n("code",[t._v("Vuex")]),t._v(" 适用于 父子、隔代、兄弟组件通信")]),t._v(" "),n("p",[t._v("Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式。每一个 Vuex 应用的核心就是 store(仓库)。“store” 基本上就是一个容器,它包含着你的应用中大部分的状态 ( state )。")]),t._v(" "),n("ul",[n("li",[t._v("Vuex 的状态存储是响应式的。当 Vue 组件从 store 中读取状态的时候,若 store 中的状态发生变化,那么相应的组件也会相应地得到高效更新。")]),t._v(" "),n("li",[t._v("改变 store 中的状态的唯一途径就是显式地提交 (commit) mutation。这样使得我们可以方便地跟踪每一个状态的变化。")])]),t._v(" "),n("h2",{attrs:{id:"_16、你使用过-vuex-吗"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_16、你使用过-vuex-吗"}},[t._v("#")]),t._v(" 16、你使用过 Vuex 吗?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式。每一个 Vuex 应用的核心就是 store(仓库)。“store” 基本上就是一个容器,它包含着你的应用中大部分的状态 ( state )。")]),t._v(" "),n("p",[t._v("(1)Vuex 的状态存储是响应式的。当 Vue 组件从 store 中读取状态的时候,若 store 中的状态发生变化,那么相应的组件也会相应地得到高效更新。")]),t._v(" "),n("p",[t._v("(2)改变 store 中的状态的唯一途径就是显式地提交 (commit) mutation。这样使得我们可以方便地跟踪每一个状态的变化。")]),t._v(" "),n("ul",[n("li",[t._v("State:定义了应用状态的数据结构,可以在这里设置默认的初始状态。")]),t._v(" "),n("li",[t._v("Getter:允许组件从 Store 中获取数据,mapGetters 辅助函数仅仅是将 store 中的 getter 映射到局部计算属性。")]),t._v(" "),n("li",[t._v("Mutation:是唯一更改 store 中状态的方法,且必须是同步函数。")]),t._v(" "),n("li",[t._v("Action:用于提交 mutation,而不是直接变更状态,可以包含任意异步操作。")]),t._v(" "),n("li",[t._v("Module:允许将单一的 Store 拆分为多个 store 且同时保存在单一的状态树中。")])]),t._v(" "),n("h2",{attrs:{id:"_17、使用过-vue-ssr-吗-说说-ssr"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_17、使用过-vue-ssr-吗-说说-ssr"}},[t._v("#")]),t._v(" 17、使用过 Vue SSR 吗?说说 SSR?")]),t._v(" "),n("hr"),t._v(" "),n("blockquote",[n("p",[t._v('Vue.js 是构建客户端应用程序的框架。默认情况下,可以在浏览器中输出 Vue 组件,进行生成 DOM 和操作 DOM。然而,也可以将同一个组件渲染为服务端的 HTML 字符串,将它们直接发送到浏览器,最后将这些静态标记"激活"为客户端上完全可交互的应用程序。'),n("br"),t._v("即:SSR 大致的意思就是 vue 在客户端将标签渲染成的整个 html 片段的工作在服务端完成,服务端形成的 html 片段直接返回给客户端这个过程就叫做服务端渲染。")])]),t._v(" "),n("p",[t._v("服务端渲染 SSR 的优缺点如下:")]),t._v(" "),n("p",[t._v("(1)服务端渲染的优点:")]),t._v(" "),n("ul",[n("li",[t._v("更好的 SEO: 因为 SPA 页面的内容是通过 Ajax 获取,而搜索引擎爬取工具并不会等待 Ajax 异步完成后再抓取页面内容,所以在 SPA 中是抓取不到页面通过 Ajax 获取到的内容;而 SSR 是直接由服务端返回已经渲染好的页面(数据已经包含在页面中),所以搜索引擎爬取工具可以抓取渲染好的页面;")]),t._v(" "),n("li",[t._v("更快的内容到达时间(首屏加载更快): SPA 会等待所有 Vue 编译后的 js 文件都下载完成后,才开始进行页面的渲染,文件下载等需要一定的时间等,所以首屏渲染需要一定的时间;SSR 直接由服务端渲染好页面直接返回显示,无需等待下载 js 文件及再去渲染等,所以 SSR 有更快的内容到达时间;")])]),t._v(" "),n("p",[t._v("(2) 服务端渲染的缺点:")]),t._v(" "),n("ul",[n("li",[t._v("更多的开发条件限制: 例如服务端渲染只支持 beforCreate 和 created 两个钩子函数,这会导致一些外部扩展库需要特殊处理,才能在服务端渲染应用程序中运行;并且与可以部署在任何静态文件服务器上的完全静态单页面应用程序 SPA 不同,服务端渲染应用程序,需要处于 Node.js server 运行环境;")]),t._v(" "),n("li",[t._v("更多的服务器负载:在 Node.js 中渲染完整的应用程序,显然会比仅仅提供静态文件的 server 更加大量占用 CPU 资源 (CPU-intensive - CPU 密集),因此如果你预料在高流量环境 ( high traffic ) 下使用,请准备相应的服务器负载,并明智地采用缓存策略。")])]),t._v(" "),n("h2",{attrs:{id:"_18、vue-router-路由模式有几种"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_18、vue-router-路由模式有几种"}},[t._v("#")]),t._v(" 18、vue-router 路由模式有几种?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("vue-router 有 3 种路由模式:hash、history、abstract,对应的源码如下所示:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("switch")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mode"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"history"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("history "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HTML5History")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("base"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hash"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("history "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashHistory")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("base"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fallback"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"abstract"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("history "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("AbstractHistory")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("base"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("env"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token constant"}},[t._v("NODE_ENV")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!==")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"production"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("assert")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token template-string"}},[n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("invalid mode: ")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("mode"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br")])]),n("p",[t._v("其中,3 种路由模式的说明如下:")]),t._v(" "),n("ul",[n("li",[t._v("hash: 使用 URL hash 值来作路由。支持所有浏览器,包括不支持 HTML5 History Api 的浏览器;")]),t._v(" "),n("li",[t._v("history : 依赖 HTML5 History API 和服务器配置。具体可以查看 HTML5 History 模式;")]),t._v(" "),n("li",[t._v("abstract : 支持所有 JavaScript 运行环境,如 Node.js 服务器端。如果发现没有浏览器的 API,路由会自动强制进入这个模式.")])]),t._v(" "),n("h2",{attrs:{id:"_19、能说下-vue-router-中常用的-hash-和-history-路由模式实现原理吗"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_19、能说下-vue-router-中常用的-hash-和-history-路由模式实现原理吗"}},[t._v("#")]),t._v(" 19、能说下 vue-router 中常用的 hash 和 history 路由模式实现原理吗?")]),t._v(" "),n("hr"),t._v(" "),n("h3",{attrs:{id:"_1-hash-模式的实现原理"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-hash-模式的实现原理"}},[t._v("#")]),t._v(" (1)hash 模式的实现原理")]),t._v(" "),n("p",[t._v("早期的前端路由的实现就是基于 location.hash 来实现的。其实现原理很简单,location.hash 的值就是 URL 中 # 后面的内容。比如下面这个网站,它的 location.hash 的值为 '#search':")]),t._v(" "),n("div",{staticClass:"language- line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("https://www.word.com#search\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br")])]),n("p",[t._v("hash 路由模式的实现主要是基于下面几个特性:")]),t._v(" "),n("ul",[n("li",[t._v("URL 中 hash 值只是客户端的一种状态,也就是说当向服务器端发出请求时,hash 部分不会被发送;")]),t._v(" "),n("li",[t._v("hash 值的改变,都会在浏览器的访问历史中增加一个记录。因此我们能通过浏览器的回退、前进按钮控制 hash 的切换;")]),t._v(" "),n("li",[t._v("可以通过 a 标签,并设置 href 属性,当用户点击这个标签后,URL 的 hash 值会发生改变;或者使用 JavaScript 来对 loaction.hash 进行赋值,改变 URL 的 hash 值;")]),t._v(" "),n("li",[t._v("我们可以使用 hashchange 事件来监听 hash 值的变化,从而对页面进行跳转(渲染)。")])]),t._v(" "),n("h3",{attrs:{id:"_2-history-模式的实现原理"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-history-模式的实现原理"}},[t._v("#")]),t._v(" (2)history 模式的实现原理")]),t._v(" "),n("p",[t._v("HTML5 提供了 History API 来实现 URL 的变化。其中做最主要的 API 有以下两个:history.pushState() 和 history.repalceState()。这两个 API 可以在不进行刷新的情况下,操作浏览器的历史纪录。唯一不同的是,前者是新增一个历史记录,后者是直接替换当前的历史记录,如下所示:")]),t._v(" "),n("div",{staticClass:"language- line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-text"}},[n("code",[t._v("window.history.pushState(null, null, path);\nwindow.history.replaceState(null, null, path);\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br")])]),n("p",[t._v("history 路由模式的实现主要基于存在下面几个特性:")]),t._v(" "),n("ul",[n("li",[t._v("pushState 和 repalceState 两个 API 来操作实现 URL 的变化 ;")]),t._v(" "),n("li",[t._v("我们可以使用 popstate 事件来监听 url 的变化,从而对页面进行跳转(渲染);")]),t._v(" "),n("li",[t._v("history.pushState() 或 history.replaceState() 不会触发 popstate 事件,这时我们需要手动触发页面跳转(渲染)。")])]),t._v(" "),n("h2",{attrs:{id:"_20、什么是-mvvm"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_20、什么是-mvvm"}},[t._v("#")]),t._v(" 20、什么是 MVVM?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("Model–View–ViewModel (MVVM)是一种软件架构设计模式,有微软 WPF 和 Silverlight 的架构师 Ken Cooper 和 Ted Peters 开发,是一种简化用户界面的事件驱动编程方式。由 John Gossman(同样也是 WPF 和 Silverlight 的架构师)于 2005 年在他的博客发表")]),t._v(" "),n("p",[t._v("MVVM 源自于经典的 Model-View-Controller(MVC)模式,MVVM 的出现促进了前端开发与后端业务逻辑的分离,极大的提高了前端开发效率,MVVM 的核心是 ViewModel 层,它就像是一个中转站(value converter),负责转换 Model 中的数据对象来让数据变得更容易管理和使用,该层向上与视图层进行双向绑定,向下与 Model 层通过接口请求进行数据交互,启呈上启下作用,如下:")]),t._v(" "),n("p",[n("img",{attrs:{src:a(542),alt:"什么是 MVVM?",title:"什么是 MVVM?"}})]),t._v(" "),n("h3",{attrs:{id:"_1-view-层"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-view-层"}},[t._v("#")]),t._v(" (1)View 层")]),t._v(" "),n("p",[t._v("View 是视图层,也就是用户界面。前端主要由 HTML 和 CSS 来构建。")]),t._v(" "),n("h3",{attrs:{id:"_2-model-层"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-model-层"}},[t._v("#")]),t._v(" (2)Model 层")]),t._v(" "),n("p",[t._v("Model 是指数据模型,泛指后端进行的各种业务逻辑处理和数据操控,对于前端来说就是后端提供的 api 接口。")]),t._v(" "),n("h3",{attrs:{id:"_3-viewmodel-层"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-viewmodel-层"}},[t._v("#")]),t._v(" (3)ViewModel 层")]),t._v(" "),n("p",[t._v("ViewModel 是由前端开发人员组织生成和维护的视图数据层。在这一层,前端开发者对从后端获取的 Model 数据进行转换处理,做二次封装,以生成符合 View 层使用预期的视图数据模型。需要注意的是 ViewModel 所封装出来的数据模型包括视图的状态和行为两部分,而 Model 层的数据模型是只包含状态的,比如页面的这一块展示什么,而页面加载进来时发生什么,点击这一块发生什么,这一块滚动时发生什么这些都属于视图行为(交互),视图状态和行为都封装在了 ViewModel 里。这样的封装使得 ViewModel 可以完整地去描述 View 层。")]),t._v(" "),n("p",[t._v("MVVM 框架实现了双向绑定,这样 ViewModel 的内容会实时展现在 View 层,前端开发者再也不必低效又麻烦地通过操纵 DOM 去更新视图,MVVM 框架已经把最脏最累的一块做好了,我们开发者只需要处理和维护 ViewModel,更新数据视图就会自动得到相应更新。这样 View 层展现的不是 Model 层的数据,而是 ViewModel 的数据,由 ViewModel 负责与 Model 层交互,这就完全解耦了 View 层和 Model 层,这个解耦是至关重要的,它是前后端分离方案实施的重要一环。")]),t._v(" "),n("p",[t._v("我们以下通过一个 Vue 实例来说明 MVVM 的具体实现,有 Vue 开发经验的同学应该一目了然:")]),t._v(" "),n("p",[t._v("(1)View 层")]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("id")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("app"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("p")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("{{message}}"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("button")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[n("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("v-on:")]),t._v("click")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("showMessage()"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("Click me"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br")])]),n("p",[t._v("(2)ViewModel 层")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" app "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Vue")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("el")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#app"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("data")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 用于描述视图状态")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("message")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Hello Vue!"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("methods")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 用于描述视图行为")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("showMessage")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" vm "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("alert")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("vm"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("message"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("created")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" vm "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Ajax 获取 Model 层的数据")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("ajax")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("url")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/your/server/data/api"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("success")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("res")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n vm"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("message "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br"),n("span",{staticClass:"line-number"},[t._v("24")]),n("br")])]),n("p",[t._v("(3) Model 层")]),t._v(" "),n("div",{staticClass:"language-json line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-json"}},[n("code",[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v('"url"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/your/server/data/api"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v('"res"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v('"success"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"IoveC"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v('"domain"')]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"www.cnblogs.com"')]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br")])]),n("h2",{attrs:{id:"_21、vue-是如何实现数据双向绑定的"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_21、vue-是如何实现数据双向绑定的"}},[t._v("#")]),t._v(" 21、Vue 是如何实现数据双向绑定的?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("Vue 数据双向绑定主要是指:数据变化更新视图,视图变化更新数据,如下图所示:")]),t._v(" "),n("p",[n("img",{attrs:{src:a(543),alt:"Vue 是如何实现数据双向绑定的?",title:"Vue 是如何实现数据双向绑定的?"}})]),t._v(" "),n("p",[t._v("即:")]),t._v(" "),n("ul",[n("li",[t._v("输入框内容变化时,Data 中的数据同步变化。即 View => Data 的变化。")]),t._v(" "),n("li",[t._v("Data 中的数据变化时,文本节点的内容同步变化。即 Data => View 的变化。")])]),t._v(" "),n("p",[t._v("其中,View 变化更新 Data ,可以通过事件监听的方式来实现,所以 Vue 的数据双向绑定的工作主要是如何根据 Data 变化更新 View。")]),t._v(" "),n("p",[t._v("Vue 主要通过以下 4 个步骤来实现数据双向绑定的:")]),t._v(" "),n("p",[t._v("实现一个监听器 Observer:对数据对象进行遍历,包括子属性对象的属性,利用 Object.defineProperty() 对属性都加上 setter 和 getter。这样的话,给这个对象的某个值赋值,就会触发 setter,那么就能监听到了数据变化。")]),t._v(" "),n("p",[t._v("实现一个解析器 Compile:解析 Vue 模板指令,将模板中的变量都替换成数据,然后初始化渲染页面视图,并将每个指令对应的节点绑定更新函数,添加监听数据的订阅者,一旦数据有变动,收到通知,调用更新函数进行数据更新。")]),t._v(" "),n("p",[t._v("实现一个订阅者 Watcher:Watcher 订阅者是 Observer 和 Compile 之间通信的桥梁 ,主要的任务是订阅 Observer 中的属性值变化的消息,当收到属性值变化的消息时,触发解析器 Compile 中对应的更新函数。")]),t._v(" "),n("p",[t._v("实现一个订阅器 Dep:订阅器采用 发布-订阅 设计模式,用来收集订阅者 Watcher,对监听器 Observer 和 订阅者 Watcher 进行统一管理。")]),t._v(" "),n("p",[n("img",{attrs:{src:a(544),alt:"Vue 是如何实现数据双向绑定的?",title:"Vue 是如何实现数据双向绑定的?"}})]),t._v(" "),n("h3",{attrs:{id:"_22、vue-框架怎么实现对象和数组的监听"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_22、vue-框架怎么实现对象和数组的监听"}},[t._v("#")]),t._v(" 22、Vue 框架怎么实现对象和数组的监听?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("如果被问到 Vue 怎么实现数据双向绑定,大家肯定都会回答 通过 Object.defineProperty() 对数据进行劫持,但是 Object.defineProperty() 只能对属性进行数据劫持,不能对整个对象进行劫持,同理无法对数组进行劫持,但是我们在使用 Vue 框架中都知道,Vue 能检测到对象和数组(部分方法的操作)的变化,那它是怎么实现的呢?我们查看相关代码如下:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Observe a list of Array items.\n */")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("observeArray")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("items")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Array"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("any"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" i "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" l "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" items"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" l"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("observe")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("items"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// observe 功能为监测数据的变化")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * 对属性进行递归遍历\n */")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" childOb "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("shallow "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("observe")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// observe 功能为监测数据的变化")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br")])]),n("p",[t._v("通过以上 Vue 源码部分查看,我们就能知道 Vue 框架是通过遍历数组 和递归遍历对象,从而达到利用 Object.defineProperty() 也能对对象和数组(部分方法的操作)进行监听。")]),t._v(" "),n("h3",{attrs:{id:"_23、proxy-与-object-defineproperty-优劣对比"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_23、proxy-与-object-defineproperty-优劣对比"}},[t._v("#")]),t._v(" 23、Proxy 与 Object.defineProperty 优劣对比")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("Proxy 的优势如下:")]),t._v(" "),n("ul",[n("li",[t._v("Proxy 可以直接监听对象而非属性;")]),t._v(" "),n("li",[t._v("Proxy 可以直接监听数组的变化;")]),t._v(" "),n("li",[t._v("Proxy 有多达 13 种拦截方法,不限于 apply、ownKeys、deleteProperty、has 等等是 Object.defineProperty 不具备的;")]),t._v(" "),n("li",[t._v("Proxy 返回的是一个新对象,我们可以只操作新的对象达到目的,而 Object.defineProperty 只能遍历对象属性直接修改;")]),t._v(" "),n("li",[t._v("Proxy 作为新标准将受到浏览器厂商重点持续的性能优化,也就是传说中的新标准的性能红利;")])]),t._v(" "),n("p",[t._v("Object.defineProperty 的优势如下:")]),t._v(" "),n("ul",[n("li",[t._v("兼容性好,支持 IE9,而 Proxy 的存在浏览器兼容性问题,而且无法用 polyfill 磨平,因此 Vue 的作者才声明需要等到下个大版本( 3.0 )才能用 Proxy 重写。")])]),t._v(" "),n("h2",{attrs:{id:"_24、vue-怎么用-vm-set-解决对象新增属性不能响应的问题"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_24、vue-怎么用-vm-set-解决对象新增属性不能响应的问题"}},[t._v("#")]),t._v(" 24、Vue 怎么用 vm.$set() 解决对象新增属性不能响应的问题 ?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("受现代 JavaScript 的限制 ,Vue  无法检测到对象属性的添加或删除。由于 Vue 会在初始化实例时对属性执行 getter/setter 转化,所以属性必须在 data  对象上存在才能让 Vue 将它转换为响应式的。但是 Vue 提供了 Vue.set (object, propertyName, value) / vm.$set (object, propertyName, value) 来实现为对象添加响应式属性,那框架本身是如何实现的呢?")]),t._v(" "),n("p",[t._v("我们查看对应的 Vue 源码:vue/src/core/instance/index.js")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("export")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("set")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("target")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Array"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("any"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" Object"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("key")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" any"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("val")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" any")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" any "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// target 为数组")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Array"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("isArray")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("isValidArrayIndex")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 修改数组的长度, 避免索引>数组长度导致splcie()执行有误")]),t._v("\n target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Math"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("max")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 利用数组的splice变异方法触发响应式")]),t._v("\n target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("splice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// key 已经存在,直接修改属性值")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" target "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" ob "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("target"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" any"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("__ob__"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// target 本身就不是响应式数据, 直接赋值")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("ob"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 对属性进行响应式处理")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("defineReactive")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ob"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n ob"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("dep"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("notify")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br"),n("span",{staticClass:"line-number"},[t._v("24")]),n("br"),n("span",{staticClass:"line-number"},[t._v("25")]),n("br")])]),n("p",[t._v("我们阅读以上源码可知,vm.$set 的实现原理是:")]),t._v(" "),n("ul",[n("li",[t._v("如果目标是数组,直接使用数组的 splice 方法触发响应式;")]),t._v(" "),n("li",[t._v("如果目标是对象,会先判读属性是否存在、对象是否是响应式,最终如果要对属性进行响应式处理,则是通过调用 defineReactive 方法进行响应式处理( defineReactive 方法就是 Vue 在初始化对象时,给对象属性采用 Object.defineProperty 动态添加 getter 和 setter 的功能所调用的方法)")])]),t._v(" "),n("h2",{attrs:{id:"_25、虚拟-dom-的优缺点"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_25、虚拟-dom-的优缺点"}},[t._v("#")]),t._v(" 25、虚拟 DOM 的优缺点?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("优点:")]),t._v(" "),n("ul",[n("li",[t._v("保证性能下限: 框架的虚拟 DOM 需要适配任何上层 API 可能产生的操作,它的一些 DOM 操作的实现必须是普适的,所以它的性能并不是最优的;但是比起粗暴的 DOM 操作性能要好很多,因此框架的虚拟 DOM 至少可以保证在你不需要手动优化的情况下,依然可以提供还不错的性能,即保证性能的下限;")]),t._v(" "),n("li",[t._v("无需手动操作 DOM: 我们不再需要手动去操作 DOM,只需要写好 View-Model 的代码逻辑,框架会根据虚拟 DOM 和 数据双向绑定,帮我们以可预期的方式更新视图,极大提高我们的开发效率;")]),t._v(" "),n("li",[t._v("跨平台: 虚拟 DOM 本质上是 JavaScript 对象,而 DOM 与平台强相关,相比之下虚拟 DOM 可以进行更方便地跨平台操作,例如服务器渲染、weex 开发等等。")])]),t._v(" "),n("p",[t._v("缺点:")]),t._v(" "),n("ul",[n("li",[t._v("无法进行极致优化: 虽然虚拟 DOM + 合理的优化,足以应对绝大部分应用的性能需求,但在一些性能要求极高的应用中虚拟 DOM 无法进行针对性的极致优化。")])]),t._v(" "),n("h2",{attrs:{id:"_26、虚拟-dom-实现原理"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_26、虚拟-dom-实现原理"}},[t._v("#")]),t._v(" 26、虚拟 DOM 实现原理?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("虚拟 DOM 的实现原理主要包括以下 3 部分:")]),t._v(" "),n("ul",[n("li",[t._v("用 JavaScript 对象模拟真实 DOM 树,对真实 DOM 进行抽象;")]),t._v(" "),n("li",[t._v("diff 算法 — 比较两棵虚拟 DOM 树的差异;")]),t._v(" "),n("li",[t._v("pach 算法 — 将两个虚拟 DOM 对象的差异应用到真正的 DOM 树。")])]),t._v(" "),n("h2",{attrs:{id:"_27、vue-中的-key-有什么作用"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_27、vue-中的-key-有什么作用"}},[t._v("#")]),t._v(" 27、Vue 中的 key 有什么作用?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("key 是为 Vue 中 vnode 的唯一标记,通过这个 key,我们的 diff 操作可以更准确、更快速。Vue 的 diff 过程可以概括为:oldCh 和 newCh 各有两个头尾的变量 oldStartIndex、oldEndIndex 和 newStartIndex、newEndIndex,它们会新节点和旧节点会进行两两对比,即一共有 4 种比较方式:newStartIndex 和 oldStartIndex 、newEndIndex 和 oldEndIndex 、newStartIndex 和 oldEndIndex 、newEndIndex 和 oldStartIndex,如果以上 4 种比较都没匹配,如果设置了 key,就会用 key 再进行比较,在比较的过程中,遍历会往中间靠,一旦 StartIdx > EndIdx 表明 oldCh 和 newCh 至少有一个已经遍历完了,就会结束比较。具体有无 key 的 diff 过程,可以查看作者写的另一篇详解虚拟 DOM 的文章《深入剖析:Vue 核心之虚拟 DOM》")]),t._v(" "),n("p",[t._v("所以 Vue 中 key 的作用是:key 是为 Vue 中 vnode 的唯一标记,通过这个 key,我们的 diff 操作可以更准确、更快速")]),t._v(" "),n("p",[n("b",[t._v("更准确:")]),t._v("因为带 key 就不是就地复用了,在 sameNode 函数 a.key === b.key 对比中可以避免就地复用的情况。所以会更加准确。")]),t._v(" "),n("p",[n("b",[t._v("更快速:")]),t._v("利用 key 的唯一性生成 map 对象来获取对应节点,比遍历方式更快,源码如下:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("createKeyToOldIdx")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("children"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" beginIdx"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" endIdx")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" i"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" map "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" beginIdx"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" endIdx"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),t._v("i"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n key "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" children"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("isDef")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" map"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("key"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" i"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" map"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br")])]),n("h2",{attrs:{id:"_28、你有对-vue-项目进行哪些优化"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_28、你有对-vue-项目进行哪些优化"}},[t._v("#")]),t._v(" 28、你有对 Vue 项目进行哪些优化?")]),t._v(" "),n("hr"),t._v(" "),n("h3",{attrs:{id:"_1-代码层面的优化"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-代码层面的优化"}},[t._v("#")]),t._v(" (1)代码层面的优化")]),t._v(" "),n("ul",[n("li",[t._v("v-if 和 v-show 区分使用场景")]),t._v(" "),n("li",[t._v("computed 和 watch 区分使用场景")]),t._v(" "),n("li",[t._v("v-for 遍历必须为 item 添加 key,且避免同时使用 v-if")]),t._v(" "),n("li",[t._v("长列表性能优化")]),t._v(" "),n("li",[t._v("事件的销毁")]),t._v(" "),n("li",[t._v("图片资源懒加载")]),t._v(" "),n("li",[t._v("路由懒加载")]),t._v(" "),n("li",[t._v("第三方插件的按需引入")]),t._v(" "),n("li",[t._v("优化无限列表性能")]),t._v(" "),n("li",[t._v("服务端渲染 SSR or 预渲染")])]),t._v(" "),n("h3",{attrs:{id:"_2-webpack-层面的优化"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-webpack-层面的优化"}},[t._v("#")]),t._v(" (2)Webpack 层面的优化")]),t._v(" "),n("ul",[n("li",[t._v("Webpack 对图片进行压缩")]),t._v(" "),n("li",[t._v("减少 ES6 转为 ES5 的冗余代码")]),t._v(" "),n("li",[t._v("提取公共代码")]),t._v(" "),n("li",[t._v("模板预编译")]),t._v(" "),n("li",[t._v("提取组件的 CSS")]),t._v(" "),n("li",[t._v("优化 SourceMap")]),t._v(" "),n("li",[t._v("构建结果输出分析")]),t._v(" "),n("li",[t._v("Vue 项目的编译优化")])]),t._v(" "),n("h3",{attrs:{id:"_3-基础的-web-技术的优化"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-基础的-web-技术的优化"}},[t._v("#")]),t._v(" (3)基础的 Web 技术的优化")]),t._v(" "),n("ul",[n("li",[t._v("开启 gzip 压缩")]),t._v(" "),n("li",[t._v("浏览器缓存")]),t._v(" "),n("li",[t._v("CDN 的使用")]),t._v(" "),n("li",[t._v("使用 Chrome Performance 查找性能瓶颈")])]),t._v(" "),n("h2",{attrs:{id:"_29、对于即将到来的-vue3-0-特性你有什么了解的吗"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_29、对于即将到来的-vue3-0-特性你有什么了解的吗"}},[t._v("#")]),t._v(" 29、对于即将到来的 vue3.0 特性你有什么了解的吗?")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("Vue 3.0 正走在发布的路上,Vue 3.0 的目标是让 Vue 核心变得更小、更快、更强大,因此 Vue 3.0 增加以下这些新特性:")]),t._v(" "),n("h3",{attrs:{id:"_1-监测机制的改变"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_1-监测机制的改变"}},[t._v("#")]),t._v(" (1)监测机制的改变")]),t._v(" "),n("p",[t._v("3.0 将带来基于代理 Proxy 的 observer 实现,提供全语言覆盖的反应性跟踪。这消除了 Vue 2 当中基于 Object.defineProperty 的实现所存在的很多限制:")]),t._v(" "),n("ul",[n("li",[t._v("只能监测属性,不能监测对象")]),t._v(" "),n("li",[t._v("检测属性的添加和删除")]),t._v(" "),n("li",[t._v("检测数组索引和长度的变更")]),t._v(" "),n("li",[t._v("支持 Map、Set、WeakMap 和 WeakSet")])]),t._v(" "),n("p",[t._v("新的 observer 还提供了以下特性:")]),t._v(" "),n("ul",[n("li",[t._v("用于创建 observable 的公开 API。这为中小规模场景提供了简单轻量级的跨组件状态管理解决方案。")]),t._v(" "),n("li",[t._v("默认采用惰性观察。在 2.x 中,不管反应式数据有多大,都会在启动时被观察到。如果你的数据集很大,这可能会在应用启动时带来明显的开销。在 3.x 中,只观察用于渲染应用程序最初可见部分的数据。")]),t._v(" "),n("li",[t._v("更精确的变更通知。在 2.x 中,通过 Vue.set 强制添加新属性将导致依赖于该对象的 watcher 收到变更通知。在 3.x 中,只有依赖于特定属性的 watcher 才会收到通知。")]),t._v(" "),n("li",[t._v("不可变的 observable:我们可以创建值的“不可变”版本(即使是嵌套属性),除非系统在内部暂时将其“解禁”。这个机制可用于冻结 prop 传递或 Vuex 状态树以外的变化。")]),t._v(" "),n("li",[t._v("更好的调试功能:我们可以使用新的 renderTracked 和 renderTriggered 钩子精确地跟踪组件在什么时候以及为什么重新渲染。")])]),t._v(" "),n("h3",{attrs:{id:"_2-模板"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_2-模板"}},[t._v("#")]),t._v(" (2)模板")]),t._v(" "),n("p",[t._v("模板方面没有大的变更,只改了作用域插槽,2.x 的机制导致作用域插槽变了,父组件会重新渲染,而 3.0 把作用域插槽改成了函数的方式,这样只会影响子组件的重新渲染,提升了渲染的性能。")]),t._v(" "),n("p",[t._v("同时,对于 render 函数的方面,vue3.0 也会进行一系列更改来方便习惯直接使用 api 来生成 vdom 。")]),t._v(" "),n("h3",{attrs:{id:"_3-对象式的组件声明方式"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_3-对象式的组件声明方式"}},[t._v("#")]),t._v(" (3)对象式的组件声明方式")]),t._v(" "),n("p",[t._v("vue2.x 中的组件是通过声明的方式传入一系列 option,和 TypeScript 的结合需要通过一些装饰器的方式来做,虽然能实现功能,但是比较麻烦。3.0 修改了组件的声明方式,改成了类式的写法,这样使得和 TypeScript 的结合变得很容易。")]),t._v(" "),n("p",[t._v("此外,vue 的源码也改用了 TypeScript 来写。其实当代码的功能复杂之后,必须有一个静态类型系统来做一些辅助管理。现在 vue3.0 也全面改用 TypeScript 来重写了,更是使得对外暴露的 api 更容易结合 TypeScript。静态类型系统对于复杂代码的维护确实很有必要。")]),t._v(" "),n("h3",{attrs:{id:"_4-其它方面的更改"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_4-其它方面的更改"}},[t._v("#")]),t._v(" (4)其它方面的更改")]),t._v(" "),n("p",[t._v("vue3.0 的改变是全面的,上面只涉及到主要的 3 个方面,还有一些其他的更改:")]),t._v(" "),n("ul",[n("li",[t._v("支持自定义渲染器,从而使得 weex 可以通过自定义渲染器的方式来扩展,而不是直接 fork 源码来改的方式。")]),t._v(" "),n("li",[t._v("支持 Fragment(多个根节点)和 Protal(在 dom 其他部分渲染组建内容)组件,针对一些特殊的场景做了处理。")]),t._v(" "),n("li",[t._v("基于 treeshaking 优化,提供了更多的内置功能。")])]),t._v(" "),n("h2",{attrs:{id:"_30、手写-promise-all-和-promise-race"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_30、手写-promise-all-和-promise-race"}},[t._v("#")]),t._v(" 30、手写 Promise.all 和 Promise.race")]),t._v(" "),n("hr"),t._v(" "),n("h3",{attrs:{id:"promise-all"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#promise-all"}},[t._v("#")]),t._v(" Promise.all()")]),t._v(" "),n("p",[n("b",[t._v("核心思路:")])]),t._v(" "),n("p",[t._v("1、Promise.all 返回的肯定是一个 Promise 对象,所以可以直接写一个 return new Promise((resolve,reject)=>{})(这应该是一个惯性思维)\n2、遍历传入的参数,用 Promise.resolve()将参数“包一层”,使其变成个 Promise 对象\n3、关键点是何时“决议”,也就是合适 resolve 出来,在这里做了计数器(count),每个内部 Promise 对象决议后就将计数器加一,并判断加一后的大小是否与传入对象的数量相等,如果相等则调用 resolve,如果任何一个 promise 对象失败,则调用 reject()方法。\n4、官网规定 Promise.all()接受的参数是一个可遍历的参数,所以未必一定是一个数组,所以用 Array.from()转化一下\n5、使用 for...of 进行遍历,因为凡事可遍历的变量应该都是部署了 iterator 方法,所以用 for...of 遍历最安全")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("Promise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("all")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("iterater")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" count "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" len "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" iterater"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" res "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Promise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("item "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("of")]),t._v(" iterater"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Promise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("iterater"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),t._v("count "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" len"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("catch")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("err")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("err"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" promise1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Promise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" promise2 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Promise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"foo"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" promise3 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("all")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("promise1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" promise2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" promise3"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("values")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("values"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br"),n("span",{staticClass:"line-number"},[t._v("24")]),n("br"),n("span",{staticClass:"line-number"},[t._v("25")]),n("br")])]),n("h3",{attrs:{id:"promise-race"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#promise-race"}},[t._v("#")]),t._v(" Promise.race()")]),t._v(" "),n("p",[n("b",[t._v("核心思路:")]),t._v("\n谁先决议那么就返回谁,所以将 all 的计数器和逻辑判断全部去除掉就可以了。")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("romise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("race")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("iterater")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Promise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("item "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("of")]),t._v(" iterater"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Promise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("iterater"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("catch")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("err")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("err"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" promise1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Promise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" promise2 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Promise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"foo"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" promise3 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("race")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("promise1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" promise2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" promise3"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("values")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("values"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/12.b098df3c.js b/assets/js/12.b098df3c.js new file mode 100644 index 0000000..b024047 --- /dev/null +++ b/assets/js/12.b098df3c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{526:function(v,_,t){v.exports=t.p+"assets/img/HTTP-HTTPS.414eeca3.png"},527:function(v,_,t){v.exports=t.p+"assets/img/https.e2a94c20.png"},528:function(v,_,t){v.exports=t.p+"assets/img/https-process.9ac914dc.png"},563:function(v,_,t){"use strict";t.r(_);var T=t(9),e=Object(T.a)({},(function(){var v=this,_=v.$createElement,T=v._self._c||_;return T("ContentSlotsDistributor",{attrs:{"slot-key":v.$parent.slotKey}},[T("p",[T("img",{attrs:{src:t(526),alt:"什么是 HTTP? HTTP 和 HTTPS 的区别?",title:"什么是 HTTP? HTTP 和 HTTPS 的区别?"}})]),v._v(" "),T("h2",{attrs:{id:"一、http"}},[T("a",{staticClass:"header-anchor",attrs:{href:"#一、http"}},[v._v("#")]),v._v(" 一、HTTP")]),v._v(" "),T("hr"),v._v(" "),T("p",[T("code",[v._v("HTTP")]),v._v("(HyperText Transfer Protocol),即超文本运输协议,是实现网络通信的一种规范。")]),v._v(" "),T("p",[v._v("在计算机和网络世界有存在不同的协议,如广播协议、寻址协议、路由协议等等......")]),v._v(" "),T("p",[v._v("而"),T("code",[v._v("HTTP")]),v._v("是一个传输协议,即将数据由 A 传到 B 或 B 传到 A,并且 A 与 B 之间能够存放很多第三方,如"),T("br"),v._v("\nA<=>X<=>Y<=>Z<=>B")]),v._v(" "),T("p",[v._v("传输的数据并不是计算机地层中的二进制包,二十完整的、有意义的数据,如 HTML 文件、图片文件、查询结果等超文本,能够被上层引用识别")]),v._v(" "),T("p",[v._v("在实际应用中,"),T("code",[v._v("HTTP")]),v._v("常被用于"),T("code",[v._v("Web")]),v._v("浏览器和网站服务器之间传递信息,以明文方式发送内容,不提供任何方式的数据加密")]),v._v(" "),T("p",[v._v("特点如下:")]),v._v(" "),T("ul",[T("li",[v._v("支持客户/服务器模式")]),v._v(" "),T("li",[v._v("简单快速:客户向服务器请求服务时,只需传送请求方式和路径。由于 HTTP 协议简单,是的 HTTP 服务器的规模小,因而通信速度很快。")])]),v._v(" "),T("ul",[T("li",[v._v("灵活:HTTP 允许传输任意类型的数据对象,正在传输的类型由 Content-Type 加以标记")]),v._v(" "),T("li",[v._v("无连接:无连接的含义是限制每次连接只处理一个请求。服务器处理完客户的请求,并受到客户的应答后,即断开连接。采用这种方式可以节省传输时间")]),v._v(" "),T("li",[v._v("无状态:HTTP 协议无法根据之前的状态进行本次的请求处理")])]),v._v(" "),T("h2",{attrs:{id:"二、https"}},[T("a",{staticClass:"header-anchor",attrs:{href:"#二、https"}},[v._v("#")]),v._v(" 二、HTTPS")]),v._v(" "),T("hr"),v._v(" "),T("p",[v._v("在上述介绍"),T("code",[v._v("HTTP")]),v._v("中,了解到"),T("code",[v._v("HTTP")]),v._v("传递信息是以明文的形式发送内容,这并不安全。而"),T("code",[v._v("HTTPS")]),v._v("出现正式为了解决"),T("code",[v._v("HTTP")]),v._v("不安全的特性")]),v._v(" "),T("p",[v._v("为了保证这些隐私数据能加密传输,让"),T("code",[v._v("HTTP")]),v._v("安全运行的"),T("code",[v._v("SSL/TLS")]),v._v("协议上,即 HTTPS=HTTP+SSL/TLS,通过"),T("code",[v._v("SSL")]),v._v("证书来验证服务器的身份,并为浏览器和服务器之间的通信进行加密")]),v._v(" "),T("p",[T("code",[v._v("SSL")]),v._v("协议位于"),T("code",[v._v("TCP/IP")]),v._v("协议与各种应用层协议之间,浏览器和服务器之间在使用"),T("code",[v._v("SSL")]),v._v("建立连接时需要选择一组恰当的加密算法来实现安全通信,为数据通信提供安全支持")]),v._v(" "),T("p",[T("img",{attrs:{src:t(527),alt:"https加密、解密",title:"https加密、解密"}})]),v._v(" "),T("p",[v._v("流程图如下所示:")]),v._v(" "),T("p",[T("img",{attrs:{src:t(528),alt:"https传输流程图",title:"https传输流程图"}})]),v._v(" "),T("ul",[T("li",[v._v("首先客户端通过 URL 访问服务器建立 SSL 连接")]),v._v(" "),T("li",[v._v("服务器收到客户端请求后,会将网站支持的证书信息(证书中包含公钥)传送一份给客户端")]),v._v(" "),T("li",[v._v("客户端的服务器开始协商 SSL 连接的安全的等级,也就是信息加密的等级")]),v._v(" "),T("li",[v._v("客户端的浏览器根据双方同意的等级,建立会话密钥,然后利用网站的公钥将会话密钥加密,并传送个网站")]),v._v(" "),T("li",[v._v("服务器利用自己的私钥解密出会话密钥")]),v._v(" "),T("li",[v._v("服务器利用会话密钥加密与客户端之间的通信")])]),v._v(" "),T("h2",{attrs:{id:"三、区别"}},[T("a",{staticClass:"header-anchor",attrs:{href:"#三、区别"}},[v._v("#")]),v._v(" 三、区别")]),v._v(" "),T("hr"),v._v(" "),T("ul",[T("li",[v._v("HTTPS 是 HTTP 协议的安全版本,HTTP 协议的数据传输是明文的,是不安全的,HTTPS 使用了 SSL/TLS 协议进行了加密处理,相对更安全")]),v._v(" "),T("li",[v._v("HTTP 和 HTTPS 使用连接方式不同,默认端口也不一样,HTTP 是 80,HTTPS 是 443")]),v._v(" "),T("li",[v._v("HTTPS 由于需要设计加密以及多次握手,性能方面不如 HTTP")]),v._v(" "),T("li",[v._v("HTTPS 需要 SSL,SSL 证书需要钱,功能越强大的证书费用越高")])])])}),[],!1,null,null,null);_.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/13.401f8270.js b/assets/js/13.401f8270.js new file mode 100644 index 0000000..9a9439d --- /dev/null +++ b/assets/js/13.401f8270.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{474:function(t,e,n){},545:function(t,e,n){"use strict";n(474)},578:function(t,e,n){"use strict";n.r(e);var i=n(130),r=Object(i.b)({functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}}),p=(n(545),n(9)),a=Object(p.a)(r,void 0,void 0,!1,null,"08862138",null);e.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/14.d04817e5.js b/assets/js/14.d04817e5.js new file mode 100644 index 0000000..570d8fa --- /dev/null +++ b/assets/js/14.d04817e5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{521:function(t,s,a){t.exports=a.p+"assets/img/scroll.5e769a62.png"},522:function(t,s,a){t.exports=a.p+"assets/img/isscroll.1ac89f54.png"},556:function(t,s,a){"use strict";a.r(s);var n=a(9),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("p",[n("img",{attrs:{src:a(521),alt:"上拉加载下拉刷新",title:"上拉加载下拉刷新"}})]),t._v(" "),n("h2",{attrs:{id:"一、前言"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#一、前言"}},[t._v("#")]),t._v(" 一、前言")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("下拉刷新和上拉加载这两种交互方式通常出现在移动端中")]),t._v(" "),n("p",[t._v("本质上等同于 PC 网页中的分页,只是交互形式不同")]),t._v(" "),n("p",[t._v("开源社区也有很多优秀的解决方案,如 "),n("code",[t._v("iscroll")]),t._v("、"),n("code",[t._v("better-scroll")]),t._v("、"),n("code",[t._v("pulltorefresh.js")]),t._v(" 库等等")]),t._v(" "),n("p",[t._v("这些第三方库使用起来非常便捷")]),t._v(" "),n("p",[t._v("我们通过原生的方式实现一次上拉加载,下拉刷新,有助于对第三方库有更好的理解与使用")]),t._v(" "),n("h2",{attrs:{id:"二、实现原理"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#二、实现原理"}},[t._v("#")]),t._v(" 二、实现原理")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("上拉加载及下拉刷新都依赖于用户交互")]),t._v(" "),n("p",[t._v("最重要的是要理解在什么场景,什么时机下触发交互动作")]),t._v(" "),n("h3",{attrs:{id:"上拉加载"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#上拉加载"}},[t._v("#")]),t._v(" 上拉加载")]),t._v(" "),n("p",[t._v("首先可以看一张图")]),t._v(" "),n("p",[n("img",{attrs:{src:a(522),alt:"上拉加载下拉刷新原理",title:"上拉加载下拉刷新原理"}})]),t._v(" "),n("p",[t._v("上拉加载的本质是页面触底,或者快要触底时的动作")]),t._v(" "),n("p",[t._v("判断页面触底我们需要先了解一下下面几个属性")]),t._v(" "),n("ul",[n("li",[n("code",[t._v("scrollTop")]),t._v(":滚动视窗的高度距离"),n("code",[t._v("window")]),t._v("顶部的距离,它会随着往上滚动而不断增加,初始值是 0,它是一个变化的值")]),t._v(" "),n("li",[n("code",[t._v("clientHeight")]),t._v(":它是一个定值,表示屏幕可视区域的高度;")]),t._v(" "),n("li",[n("code",[t._v("scrollHeight")]),t._v(":页面不能滚动时是不存在的,"),n("code",[t._v("body")]),t._v("长度超过"),n("code",[t._v("window")]),t._v("时才会出现,所表示"),n("code",[t._v("body")]),t._v("所有元素的长度")])]),t._v(" "),n("p",[t._v("综上我们得出一个触底公式:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("scrollTop "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" clientHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" scrollHeight"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br")])]),n("p",[t._v("简单实现")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" clientHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("documentElement"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clientHeight"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//浏览器高度")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" scrollHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("body"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scrollHeight"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" scrollTop "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("documentElement"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scrollTop"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" distance "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//距离视窗还用50的时候,开始触发;")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("scrollTop "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" clientHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" scrollHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" distance"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"开始加载数据"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br")])]),n("h3",{attrs:{id:"下拉刷新"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#下拉刷新"}},[t._v("#")]),t._v(" 下拉刷新")]),t._v(" "),n("p",[t._v("下拉刷新的本质是页面本身置于顶部时,用户下拉时需要触发的动作")]),t._v(" "),n("p",[t._v("关于下拉刷新的原生实现,主要分成三步:")]),t._v(" "),n("ul",[n("li",[t._v("监听原生 touchstart 事件,记录其初始位置的值,e.touches[0].pageY;")]),t._v(" "),n("li",[t._v("监听原生 touchmove 事件,记录并计算当前滑动的位置值与初始位置值的差值,大于 0 表示向下拉动,并借助 CSS3 的 translateY 属性使元素跟随手势向下滑动对应的差值,同时也应设置一个允许滑动的最大值;")]),t._v(" "),n("li",[t._v("监听原生 touchend 事件,若此时元素滑动达到最大值,则触发 callback,同时将 translateY 重设为 0,元素回到初始位置")])]),t._v(" "),n("p",[t._v("举个例子:")]),t._v(" "),n("p",[n("code",[t._v("Html")]),t._v("结构如下:")]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("main")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("p")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("refreshText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("ul")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("id")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("refreshContainer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("li")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("111"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("li")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("222"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("li")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("333"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("li")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("444"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("li")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("555"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n ...\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br")])]),n("p",[t._v("监听"),n("code",[t._v("touchstart")]),t._v("事件,记录初始的值")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" _element "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("getElementById")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"refreshContainer"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n _refreshText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('".refreshText"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n _startPos "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 初始的值")]),t._v("\n _transitionHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 移动的距离")]),t._v("\n\n_element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("addEventListener")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"touchstart"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n _startPos "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("touches"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pageY"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 记录初始位置")]),t._v("\n _element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("style"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("position "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"relative"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n _element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("style"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("transition "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transform 0s"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br")])]),n("p",[t._v("监听"),n("code",[t._v("touchmove")]),t._v("移动事件,记录滑动差值")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("_element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("addEventListener")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"touchmove"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// e.touches[0].pageY 当前位置")]),t._v("\n _transitionHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("touches"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pageY "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" _startPos"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 记录差值")]),t._v("\n\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_transitionHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" _transitionHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("60")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n _refreshText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"下拉刷新"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n _element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("style"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("transform "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"translateY("')]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" _transitionHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"px)"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_transitionHeight "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("55")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n _refreshText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"释放更新"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br")])]),n("p",[t._v("最后,就是监听"),n("code",[t._v("touchend")]),t._v("离开的事件")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("_element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("addEventListener")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"touchend"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n _element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("style"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("transition "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"transform 0.5s ease 1s"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n _element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("style"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("transform "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"translateY(0px)"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n _refreshText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"更新中..."')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// todo...")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br")])]),n("p",[t._v("从上面可以看到,在下拉到松手的过程中,经历了三个阶段:")]),t._v(" "),n("ul",[n("li",[t._v("当前手势滑动位置与初始位置差值大于零时,提示正在进行下拉刷新操作")]),t._v(" "),n("li",[t._v("下拉到一定值时,显示松手释放后的操作提示")]),t._v(" "),n("li",[t._v("下拉到达设定最大值松手时,执行回调,提示正在进行更新操作")])]),t._v(" "),n("h2",{attrs:{id:"三、案例"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#三、案例"}},[t._v("#")]),t._v(" 三、案例")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("在实际开发中,我们更多的是使用第三方库,下面以"),n("code",[t._v("better-scroll")]),t._v("进行举例:")]),t._v(" "),n("p",[t._v("HTML 结构")]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("id")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("position-wrapper"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("p")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("refresh"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("下拉刷新"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("position-list"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("\x3c!--列表内容--\x3e")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("p")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("more"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("查看更多"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br")])]),n("p",[t._v("实例化上拉下拉插件,通过 use 来注册插件")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" BScroll "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@better-scroll/core"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" PullDown "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@better-scroll/pull-down"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" PullUp "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@better-scroll/pull-up"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nBScroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PullDown"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nBScroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("use")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PullUp"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br")])]),n("p",[t._v("实例化"),n("code",[t._v("BetterScroll")]),t._v(",并传入相关的参数")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" pageNo "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("pageSize "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("dataList "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("isMore "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" scroll"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("BScroll")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#position-wrapper"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("scrollY")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//垂直方向滚动")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("click")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//默认会阻止浏览器的原生click事件,如果需要点击,这里要设为true")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("pullUpLoad")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//上拉加载更多")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("pullDownRefresh")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("threshold")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//触发pullingDown事件的位置")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("stop")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//下拉回弹后停留的位置")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//监听下拉刷新")]),t._v("\nscroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("on")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"pullingDown"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("pullingDownHandler"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//监测实时滚动")]),t._v("\nscroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("on")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"scroll"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("scrollHandler"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//上拉加载更多")]),t._v("\nscroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("on")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"pullingUp"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("pullingUpHandler"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("pullingDownHandler")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n dataList"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n pageNo"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n isMore"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('".more"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("text")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"查看更多"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("getlist")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//请求数据")]),t._v("\n scroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("finishPullDown")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//每次下拉结束后,需要执行这个操作")]),t._v("\n scroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("refresh")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//当滚动区域的dom结构有变化时,需要执行这个操作")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("pullingUpHandler")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("isMore"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('".more"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("text")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"没有更多数据了"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n scroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("finishPullUp")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//每次上拉结束后,需要执行这个操作")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n pageNo"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("getlist")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//请求数据")]),t._v("\n scroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("finishPullUp")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//每次上拉结束后,需要执行这个操作")]),t._v("\n scroll"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("refresh")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//当滚动区域的dom结构有变化时,需要执行这个操作")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("scrollHandler")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("y"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.refresh'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("text")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"松手开始加载"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("$")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.refresh'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("text")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"下拉刷新"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("getlist")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//返回的数据")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" result"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n dataList"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("dataList"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("concat")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//判断是否已加载完")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("result"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("pageSize"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" isMore"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将dataList渲染到html内容中")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br"),n("span",{staticClass:"line-number"},[t._v("24")]),n("br"),n("span",{staticClass:"line-number"},[t._v("25")]),n("br"),n("span",{staticClass:"line-number"},[t._v("26")]),n("br"),n("span",{staticClass:"line-number"},[t._v("27")]),n("br"),n("span",{staticClass:"line-number"},[t._v("28")]),n("br"),n("span",{staticClass:"line-number"},[t._v("29")]),n("br"),n("span",{staticClass:"line-number"},[t._v("30")]),n("br"),n("span",{staticClass:"line-number"},[t._v("31")]),n("br"),n("span",{staticClass:"line-number"},[t._v("32")]),n("br"),n("span",{staticClass:"line-number"},[t._v("33")]),n("br"),n("span",{staticClass:"line-number"},[t._v("34")]),n("br"),n("span",{staticClass:"line-number"},[t._v("35")]),n("br"),n("span",{staticClass:"line-number"},[t._v("36")]),n("br"),n("span",{staticClass:"line-number"},[t._v("37")]),n("br"),n("span",{staticClass:"line-number"},[t._v("38")]),n("br"),n("span",{staticClass:"line-number"},[t._v("39")]),n("br"),n("span",{staticClass:"line-number"},[t._v("40")]),n("br"),n("span",{staticClass:"line-number"},[t._v("41")]),n("br"),n("span",{staticClass:"line-number"},[t._v("42")]),n("br"),n("span",{staticClass:"line-number"},[t._v("43")]),n("br"),n("span",{staticClass:"line-number"},[t._v("44")]),n("br"),n("span",{staticClass:"line-number"},[t._v("45")]),n("br"),n("span",{staticClass:"line-number"},[t._v("46")]),n("br"),n("span",{staticClass:"line-number"},[t._v("47")]),n("br"),n("span",{staticClass:"line-number"},[t._v("48")]),n("br"),n("span",{staticClass:"line-number"},[t._v("49")]),n("br")])]),n("p",[t._v("注意点:")]),t._v(" "),n("p",[t._v("使用"),n("code",[t._v("better-scroll")]),t._v(" 实现下拉刷新、上拉加载时要注意以下几点:")]),t._v(" "),n("ul",[n("li",[t._v("wrapper 里必须只有一个子元素")]),t._v(" "),n("li",[t._v("子元素的高度要比 wrapper 要高")]),t._v(" "),n("li",[t._v("使用的时候,要确定 DOM 元素是否已经生成,必须要等到 DOM 渲染完成后,再 new BScroll()")]),t._v(" "),n("li",[t._v("滚动区域的 DOM 元素结构有变化后,需要执行刷新 refresh()")]),t._v(" "),n("li",[t._v("上拉或者下拉,结束后,需要执行 finishPullUp()或者 finishPullDown(),否则将不会执行下次操作")]),t._v(" "),n("li",[t._v("better-scroll,默认会阻止浏览器的原生 click 事件,如果滚动内容区要添加点击事件,需要在实例化属性里设置 click:true")])]),t._v(" "),n("h3",{attrs:{id:"小结"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#小结"}},[t._v("#")]),t._v(" 小结")]),t._v(" "),n("p",[t._v("下拉刷新、上拉加载原理本身都很简单,真正复杂的是封装过程中,要考虑的兼容性、易用性、性能等诸多细节")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/15.e20c0fb6.js b/assets/js/15.e20c0fb6.js new file mode 100644 index 0000000..2529c9a --- /dev/null +++ b/assets/js/15.e20c0fb6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{524:function(t,s,a){t.exports=a.p+"assets/img/xmlHttpRequest.e50c8622.png"},525:function(t,s,a){t.exports=a.p+"assets/img/readyState.51fb7675.png"},560:function(t,s,a){"use strict";a.r(s);var n=a(9),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h2",{attrs:{id:"一、ajax-是什么"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#一、ajax-是什么"}},[t._v("#")]),t._v(" 一、Ajax 是什么?")]),t._v(" "),n("hr"),t._v(" "),n("p",[n("code",[t._v("AJAX")]),t._v(" 全称(Async Javascript and XML)")]),t._v(" "),n("p",[t._v("即异步的 "),n("code",[t._v("JavaScript")]),t._v(" 和 "),n("code",[t._v("XML")]),t._v(",是一种创建交互式网页应用的网页开发技术,可以在不重新加载整个网页的情况下,与服务器交换数据,并且更新部分网页")]),t._v(" "),n("p",[n("code",[t._v("Ajax")]),t._v("的原理简单来说通过"),n("code",[t._v("XmlHttpRequest")]),t._v("对象来向服务器发异步请求,从服务器获得数据,然后用 JavaScript 来操作 DOM 而更新页面")]),t._v(" "),n("p",[t._v("流程图如下:")]),t._v(" "),n("p",[n("img",{attrs:{src:a(524),alt:"new XmlHttpRequest",title:"new XmlHttpRequest"}})]),t._v(" "),n("p",[t._v("下面举个例子:")]),t._v(" "),n("p",[t._v("领导想找小李汇报一下工作,就委托秘书去叫小李,自己就接着做其他事情,直到秘书告诉他小李已经到了,最后小李跟领导汇报工作")]),t._v(" "),n("p",[t._v("浏览器可以发送"),n("code",[t._v("HTTP")]),t._v("请求后,接着做其他事情,等收到 XHR 返回来的数据再进行操作")]),t._v(" "),n("h2",{attrs:{id:"二、实现过程"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#二、实现过程"}},[t._v("#")]),t._v(" 二、实现过程")]),t._v(" "),n("hr"),t._v(" "),n("p",[t._v("实现 Ajax 异步交互需要服务器逻辑进行配合,需要完成以下步骤:")]),t._v(" "),n("ul",[n("li",[t._v("创建 Ajax 的核心对象 XMLHttpRequest 对象")]),t._v(" "),n("li",[t._v("通过 XMLHttpRequest 对象的 open() 方法与服务端建立连接")]),t._v(" "),n("li",[t._v("构建请求所需的数据内容,并通过 XMLHttpRequest 对象的 send() 方法发送给服务器端")]),t._v(" "),n("li",[t._v("通过 XMLHttpRequest 对象提供的 onreadystatechange 事件监听服务器端你的通信状态")]),t._v(" "),n("li",[t._v("接受并处理服务端向客户端响应的数据结果")]),t._v(" "),n("li",[t._v("将处理结果更新到 HTML 页面中")])]),t._v(" "),n("h3",{attrs:{id:"创建-xmlhttprequest-对象"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#创建-xmlhttprequest-对象"}},[t._v("#")]),t._v(" 创建 XMLHttpRequest 对象")]),t._v(" "),n("p",[t._v("通过"),n("code",[t._v("XMLHttpRequest()")]),t._v(" 构造函数用于初始化一个 "),n("code",[t._v("XMLHttpRequest")]),t._v(" 实例对象")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" xhr "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("XMLHttpRequest")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br")])]),n("h3",{attrs:{id:"与服务器建立连接"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#与服务器建立连接"}},[t._v("#")]),t._v(" 与服务器建立连接")]),t._v(" "),n("p",[t._v("通过 "),n("code",[t._v("XMLHttpRequest")]),t._v(" 对象的 "),n("code",[t._v("open()")]),t._v(" 方法与服务器建立连接")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("method"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" url"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("async"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" user"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" password"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br")])]),n("p",[t._v("参数说明:")]),t._v(" "),n("ul",[n("li",[n("code",[t._v("method")]),t._v(":表示当前的请求方式,常见的有"),n("code",[t._v("GET")]),t._v("、"),n("code",[t._v("POST")])]),t._v(" "),n("li",[n("code",[t._v("url")]),t._v(":服务端地址")]),t._v(" "),n("li",[n("code",[t._v("async")]),t._v(":布尔值,表示是否异步执行操作,默认为"),n("code",[t._v("true")])]),t._v(" "),n("li",[n("code",[t._v("user")]),t._v(": 可选的用户名用于认证用途;默认为"),n("code",[t._v("null")])]),t._v(" "),n("li",[n("code",[t._v("password")]),t._v(": 可选的密码用于认证用途,默认为"),n("code",[t._v("null")])])]),t._v(" "),n("h3",{attrs:{id:"给服务端发送数据"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#给服务端发送数据"}},[t._v("#")]),t._v(" 给服务端发送数据")]),t._v(" "),n("p",[t._v("通过 "),n("code",[t._v("XMLHttpRequest")]),t._v(" 对象的 "),n("code",[t._v("send()")]),t._v(" 方法,将客户端页面的数据发送给服务端")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("send")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("body"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br")])]),n("p",[n("code",[t._v("body")]),t._v(": 在 XHR 请求中要发送的数据体,如果不传递数据则为 "),n("code",[t._v("null")])]),t._v(" "),n("p",[t._v("如果使用"),n("code",[t._v("GET")]),t._v("请求发送数据的时候,需要注意如下:")]),t._v(" "),n("ul",[n("li",[t._v("将请求数据添加到"),n("code",[t._v("open()")]),t._v("方法中的"),n("code",[t._v("url")]),t._v("地址中")]),t._v(" "),n("li",[t._v("发送请求数据中的"),n("code",[t._v("send()")]),t._v("方法中参数设置为"),n("code",[t._v("null")])])]),t._v(" "),n("h3",{attrs:{id:"绑定onreadystatechange事件"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#绑定onreadystatechange事件"}},[t._v("#")]),t._v(" 绑定"),n("code",[t._v("onreadystatechange")]),t._v("事件")]),t._v(" "),n("p",[n("code",[t._v("onreadystatechange")]),t._v(" 事件用于监听服务器端的通信状态,主要监听的属性为"),n("code",[t._v("XMLHttpRequest.readyState")]),t._v(",关于"),n("code",[t._v("XMLHttpRequest.readyState")]),t._v("属性有五个状态,如下图显示")]),t._v(" "),n("p",[n("img",{attrs:{src:a(525),alt:"XMLHttpRequest.readyState",title:"XMLHttpRequest.readyState"}})]),t._v(" "),n("p",[t._v("只要 "),n("code",[t._v("readyState")]),t._v(" 属性值一变化,就会触发一次 "),n("code",[t._v("readystatechange")]),t._v(" 事件")]),t._v(" "),n("p",[n("code",[t._v("XMLHttpRequest.responseText")]),t._v("属性用于接收服务器端的响应结果")]),t._v(" "),n("p",[t._v("举个例子:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" request "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("XMLHttpRequest")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nrequest"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onreadystatechange")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("request"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("readyState "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 整个请求过程完毕")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("request"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" request"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("request"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("responseText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 服务端返回的结果")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("request"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("400")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"错误信息:"')]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" request"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("status"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nrequest"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"http://xxxx"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nrequest"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("send")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br")])]),n("h2",{attrs:{id:"三、封装"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#三、封装"}},[t._v("#")]),t._v(" 三、封装")]),t._v(" "),n("p",[t._v("通过上面对"),n("code",[t._v("XMLHttpRequest")]),t._v(" 对象的了解,下面来封装一个简单的"),n("code",[t._v("Ajax")]),t._v("请求")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//封装一个ajax请求")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("ajax")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("options")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//创建XMLHttpRequest对象")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" xhr "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("XMLHttpRequest")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//初始化参数的内容")]),t._v("\n options "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" options "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("type "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("type "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GET"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("toUpperCase")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("dataType "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("dataType "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"json"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" params "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("data"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//发送请求")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("type "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GET"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"GET"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("url "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"?"')]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" params"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("send")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("type "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"POST"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("url"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("send")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("params"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//接收请求")]),t._v("\n xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onreadystatechange")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("readyState "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("status"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("success "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("success")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("responseText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" xhr"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("responseXML"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("error "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" options"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("error")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("status"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br"),n("span",{staticClass:"line-number"},[t._v("24")]),n("br"),n("span",{staticClass:"line-number"},[t._v("25")]),n("br"),n("span",{staticClass:"line-number"},[t._v("26")]),n("br"),n("span",{staticClass:"line-number"},[t._v("27")]),n("br"),n("span",{staticClass:"line-number"},[t._v("28")]),n("br"),n("span",{staticClass:"line-number"},[t._v("29")]),n("br"),n("span",{staticClass:"line-number"},[t._v("30")]),n("br"),n("span",{staticClass:"line-number"},[t._v("31")]),n("br")])]),n("p",[t._v("使用方式如下")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token function"}},[t._v("ajax")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("type")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"post"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("dataType")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"json"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("data")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("url")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://xxxx"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("success")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("text"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" xml")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//请求成功后的回调函数")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("text"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("error")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("status")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("////请求失败后的回调函数")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("status"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/16.3b04dda9.js b/assets/js/16.3b04dda9.js new file mode 100644 index 0000000..588b3cd --- /dev/null +++ b/assets/js/16.3b04dda9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{518:function(s,t,a){s.exports=a.p+"assets/img/JavaScriptArray.d4585bee.png"},553:function(s,t,a){"use strict";a.r(t);var n=a(9),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,n=s._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[n("p",[n("img",{attrs:{src:a(518),alt:"JavaScript数组的常用方法有哪些",title:"JavaScript数组的常用方法有哪些"}})]),s._v(" "),n("h2",{attrs:{id:"一、操作方法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#一、操作方法"}},[s._v("#")]),s._v(" 一、操作方法")]),s._v(" "),n("hr"),s._v(" "),n("p",[s._v("数组基本操作可以归纳为 增、删、改、查,需要留意的是哪些方法会对原数组产生影响,哪些方法不会")]),s._v(" "),n("p",[s._v("下面对数组常用的操作方法做一个归纳")]),s._v(" "),n("p",[n("b",[s._v("增")])]),s._v(" "),n("p",[s._v("下面前三种是对原数组产生影响的增添方法,第四种则不会对原数组产生印象")]),s._v(" "),n("ul",[n("li",[s._v("push()")]),s._v(" "),n("li",[s._v("unshift()")]),s._v(" "),n("li",[s._v("splice()")]),s._v(" "),n("li",[s._v("concat()")])]),s._v(" "),n("p",[s._v("push()")]),s._v(" "),n("p",[n("code",[s._v("push()")]),s._v("方法接受任意数量的参数,并将它们添加到数组末尾,返回数组的最新长度")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//创建一个数组")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" count "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("push")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//从数组末尾传入两项")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token template-string"}},[n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[s._v("`")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v("count:")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[s._v("${")]),s._v("count"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[s._v("}")])]),n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[s._v("`")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])]),n("p",[s._v("unshift()")]),s._v(" "),n("p",[n("code",[s._v("unshift()")]),s._v("在数组开头添加任意多个值,然后返回新的数组长度")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//创建一个数组")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" count "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("unshift")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//从数组开头传入两项")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token template-string"}},[n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[s._v("`")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v("count:")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[s._v("${")]),s._v("count"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[s._v("}")])]),n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[s._v("`")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])]),n("p",[s._v("splice()")]),s._v(" "),n("p",[n("code",[s._v("splice()")]),s._v("传入三个参数,分别是开始位置、0(要删除的元素数量)、插入的元素,返回空数组")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"blue"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" removed "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("splice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"yellow"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"orange"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// red,yellow,orange,green,blue")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("removed"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// []")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br")])]),n("p",[s._v("concat()")]),s._v(" "),n("p",[n("code",[s._v("concat()")]),s._v("首先会创建一个当前数组的副本,然后再把它的参数添加到副本末尾,最后返回这个新构建的数组,不会影响原始数组")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"blue"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors2 "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("concat")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"yellow"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"black"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"brown"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v('// ["red", "green","blue"]')]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v('// ["red", "green", "blue", "yellow", "black", "brown"]')]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br")])]),n("p",[n("b",[s._v("删")])]),s._v(" "),n("p",[s._v("下面三种都会影响原数组,最后一项不影响原数组:")]),s._v(" "),n("ul",[n("li",[s._v("pop()")]),s._v(" "),n("li",[s._v("shift()")]),s._v(" "),n("li",[s._v("splice()")]),s._v(" "),n("li",[s._v("slice()")])]),s._v(" "),n("p",[s._v("pop()")]),s._v(" "),n("p",[n("code",[s._v("pop()")]),s._v("方法用于删除数组的最后一项,同时减少数组的 "),n("code",[s._v("length")]),s._v(" 值,返回被删除的项")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" item "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("pop")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 取得最后一项")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// green")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("length"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 1")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br")])]),n("p",[s._v("shift()")]),s._v(" "),n("p",[n("code",[s._v("shift()")]),s._v("方法用于删除数组的第一项,同时减少数组的 "),n("code",[s._v("length")]),s._v(" 值,返回被删除的项")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" item "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("shift")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 取得第一项")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// red")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("length"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 1")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br")])]),n("p",[s._v("splice()")]),s._v(" "),n("p",[n("code",[s._v("splice()")]),s._v("传入两个参数,分别是开始位置,删除元素的数量,返回包含删除元素的数组")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"blue"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" removed "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("splice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 删除第一项")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// green,blue")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("removed"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// red,只有一个元素的数组")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br")])]),n("p",[s._v("slice()")]),s._v(" "),n("p",[n("code",[s._v("slice()")]),s._v("用于创建一个包含原有数组中一个或多个元素的新数组,不会影响原始数组")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"blue"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"yellow"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"purple"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors2 "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("slice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors3 "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("slice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// red,green,blue,yellow,purple")]),s._v("\nconcole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// green,blue,yellow,purple")]),s._v("\nconcole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors3"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// green,blue,yellow")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br"),n("span",{staticClass:"line-number"},[s._v("5")]),n("br"),n("span",{staticClass:"line-number"},[s._v("6")]),n("br")])]),n("p",[n("b",[s._v("改")])]),s._v(" "),n("p",[s._v("即修改原来数组的内容,常用"),n("code",[s._v("splice")])]),s._v(" "),n("p",[n("code",[s._v("splice()")]),s._v("传入三个参数,分别是开始位置,要删除元素的数量,要插入的任意多个元素,返回删除元素的数组,对原数组产生影响")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"blue"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" removed "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("splice")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"purple"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 插入两个值,删除一个元素")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// red,red,purple,blue")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("removed"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// green,只有一个元素的数组")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br")])]),n("p",[n("b",[s._v("查")])]),s._v(" "),n("p",[s._v("即查找元素,返回元素坐标或者元素值")]),s._v(" "),n("ul",[n("li",[s._v("indexOf()")]),s._v(" "),n("li",[s._v("includes()")]),s._v(" "),n("li",[s._v("find()")])]),s._v(" "),n("p",[s._v("indexOf()")]),s._v(" "),n("p",[s._v("返回要查找的元素在数组中的位置,如果没找到则返回-1")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" numbers "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nnumbers"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("indexOf")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 3")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br")])]),n("p",[s._v("includes()")]),s._v(" "),n("p",[s._v("返回要查找的元素在数组中的位置,找到返回"),n("code",[s._v("true")]),s._v(",否则"),n("code",[s._v("false")])]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" numbers "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nnumbers"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("includes")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// true")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br")])]),n("p",[s._v("find()")]),s._v(" "),n("p",[s._v("返回第一个匹配的元素")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" people "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("name")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"Matt"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("age")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("27")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("name")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"Nicholas"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("age")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("29")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\npeople"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("find")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" index"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" element"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("age "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("28")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v('// // {name: "Matt", age: 27}')]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br"),n("span",{staticClass:"line-number"},[s._v("5")]),n("br"),n("span",{staticClass:"line-number"},[s._v("6")]),n("br"),n("span",{staticClass:"line-number"},[s._v("7")]),n("br"),n("span",{staticClass:"line-number"},[s._v("8")]),n("br"),n("span",{staticClass:"line-number"},[s._v("9")]),n("br"),n("span",{staticClass:"line-number"},[s._v("10")]),n("br"),n("span",{staticClass:"line-number"},[s._v("11")]),n("br")])]),n("h2",{attrs:{id:"二、排序方法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#二、排序方法"}},[s._v("#")]),s._v(" 二、排序方法")]),s._v(" "),n("hr"),s._v(" "),n("p",[s._v("数组有两个方法可以用来对元素重新排序:")]),s._v(" "),n("ul",[n("li",[s._v("reverse()")]),s._v(" "),n("li",[s._v("sort()")])]),s._v(" "),n("p",[n("b",[s._v("reverse()")])]),s._v(" "),n("p",[s._v("顾名思义,将数组元素反向排列")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" values "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nvalues"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("reverse")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("alert")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("values"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 5,4,3,2,1")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])]),n("p",[n("b",[s._v("sort()")])]),s._v(" "),n("p",[s._v("sort()方法接受一个比较函数,用于判断哪个值应该排在前面")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("compare")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("value1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" value2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("value1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),s._v(" value2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("-")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("else")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("value1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" value2"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("else")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" values "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("10")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("15")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nvalues"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("sort")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("compare"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("alert")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("values"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 0,1,5,10,15")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br"),n("span",{staticClass:"line-number"},[s._v("5")]),n("br"),n("span",{staticClass:"line-number"},[s._v("6")]),n("br"),n("span",{staticClass:"line-number"},[s._v("7")]),n("br"),n("span",{staticClass:"line-number"},[s._v("8")]),n("br"),n("span",{staticClass:"line-number"},[s._v("9")]),n("br"),n("span",{staticClass:"line-number"},[s._v("10")]),n("br"),n("span",{staticClass:"line-number"},[s._v("11")]),n("br"),n("span",{staticClass:"line-number"},[s._v("12")]),n("br")])]),n("h2",{attrs:{id:"三、转换方法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#三、转换方法"}},[s._v("#")]),s._v(" 三、转换方法")]),s._v(" "),n("hr"),s._v(" "),n("p",[s._v("常见的转换方法有:")]),s._v(" "),n("p",[n("b",[s._v("join()")])]),s._v(" "),n("p",[s._v("join() 方法接收一个参数,即字符串分隔符,返回包含所有项的字符串")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" colors "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"red"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"green"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"blue"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("alert")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("join")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('","')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// red,green,blue")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("alert")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("colors"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("join")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"||"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// red||green||blue")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])]),n("h2",{attrs:{id:"四、迭代方法"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#四、迭代方法"}},[s._v("#")]),s._v(" 四、迭代方法")]),s._v(" "),n("hr"),s._v(" "),n("p",[s._v("常用来迭代数组的方法(都不改变原数组)有如下:")]),s._v(" "),n("ul",[n("li",[s._v("some()")]),s._v(" "),n("li",[s._v("every()")]),s._v(" "),n("li",[s._v("forEach()")]),s._v(" "),n("li",[s._v("filter()")]),s._v(" "),n("li",[s._v("map()")])]),s._v(" "),n("p",[s._v("some()")]),s._v(" "),n("p",[s._v("对数组每一项都运行传入的函数,如果有一项函数返回 true ,则这个方法返回 true")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" numbers "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" someResult "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" numbers"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("some")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" index"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" item "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("someResult"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// true")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])]),n("p",[s._v("every()")]),s._v(" "),n("p",[s._v("对数组每一项都运行传入的函数,如果对每一项函数都返回 true ,则这个方法返回 true")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" numbers "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" everyResult "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" numbers"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("every")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" index"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" item "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("everyResult"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// false")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])]),n("p",[s._v("forEach()")]),s._v(" "),n("p",[s._v("对数组每一项都运行传入的函数,没有返回值")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" numbers "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nnumbers"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("forEach")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" index"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 执行某些操作")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br")])]),n("p",[s._v("filter()")]),s._v(" "),n("p",[s._v("对数组每一项都运行传入的函数,函数返回 true 的项会组成数组之后返回")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" numbers "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" filterResult "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" numbers"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("filter")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" index"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" item "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("filterResult"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 3,4,5,4,3")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])]),n("p",[s._v("map()")]),s._v(" "),n("p",[s._v("对数组每一项都运行传入的函数,返回由每次函数调用的结果构成的数组")]),s._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" numbers "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" mapResult "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" numbers"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("map")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("item"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" index"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" array")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" item "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("mapResult"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 2,4,6,8,10,8,6,4,2")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br")])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/17.74a602dd.js b/assets/js/17.74a602dd.js new file mode 100644 index 0000000..2c428fa --- /dev/null +++ b/assets/js/17.74a602dd.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{519:function(t,s,a){t.exports=a.p+"assets/img/event_loop.27d58f28.png"},554:function(t,s,a){"use strict";a.r(s);var n=a(9),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h2",{attrs:{id:"一、event-loop、宏任务和微任务"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#一、event-loop、宏任务和微任务"}},[t._v("#")]),t._v(" 一、event loop、宏任务和微任务")]),t._v(" "),n("p",[t._v("首先推荐一个可以在线看代码流程的网站:"),n("a",{attrs:{href:"http://latentflip.com/loupe/?code=JC5vbignYnV0dG9uJywgJ2NsaWNrJywgZnVuY3Rpb24gb25DbGljaygpIHsKICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gdGltZXIoKSB7CiAgICAgICAgY29uc29sZS5sb2coJ1lvdSBjbGlja2VkIHRoZSBidXR0b24hJyk7ICAgIAogICAgfSwgMjAwMCk7Cn0pOwoKY29uc29sZS5sb2coIkhpISIpOwoKc2V0VGltZW91dChmdW5jdGlvbiB0aW1lb3V0KCkgewogICAgY29uc29sZS5sb2coIkNsaWNrIHRoZSBidXR0b24hIik7Cn0sIDUwMDApOwoKY29uc29sZS5sb2coIldlbGNvbWUgdG8gbG91cGUuIik7!!!PGJ1dHRvbj5DbGljayBtZSE8L2J1dHRvbj4%3D",target:"_blank",rel:"noopener noreferrer"}},[t._v("loupe"),n("OutboundLink")],1),t._v("。 然后看下这个视频学习下:"),n("a",{attrs:{href:"https://www.bilibili.com/video/BV1oV411k7XY/?spm_id_from=333.788.recommend_more_video.-1",target:"_blank",rel:"noopener noreferrer"}},[t._v("到底什么是 Event Loop 呢?"),n("OutboundLink")],1)]),t._v(" "),n("p",[t._v("简单的例子:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Hi"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"cb"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("5000")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nconsole"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Bye"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br")])]),n("p",[t._v("它的执行过程是这样的:")]),t._v(" "),n("p",[n("img",{attrs:{src:a(519),alt:"event loop、宏任务和微任务"}})]),t._v(" "),n("p",[t._v("Web APIs 会创建对应的线程,比如 setTimeout 会创建定时器线程,ajax 请求会创建 http 线程。。。这是由 js 的运行环境决定的,比如浏览器。")]),t._v(" "),n("p",[t._v("看完上面的视频之后,至少大家画 Event Loop 的图讲解不是啥问题了,但是涉及到宏任务和微任务,我们还得拜读一下这篇文章:"),n("a",{attrs:{href:"https://juejin.cn/post/6844903512845860872",target:"_blank",rel:"noopener noreferrer"}},[t._v("这一次,彻底弄懂 JavaScript 执行机制"),n("OutboundLink")],1),t._v("。如果意犹未尽,不如再读下这篇非常详细带有大量动图的文章:"),n("a",{attrs:{href:"https://juejin.cn/post/6969028296893792286#comment",target:"_blank",rel:"noopener noreferrer"}},[t._v("做一些动图,学习一下 EventLoop"),n("OutboundLink")],1),t._v("。想了解事件循环和页面渲染之间关系的又可以再阅读这篇文章:"),n("a",{attrs:{href:"https://juejin.cn/post/6844904165462769678",target:"_blank",rel:"noopener noreferrer"}},[t._v("深入解析你不知道的 EventLoop 和浏览器渲染、帧动画、空闲回调(动图演示)"),n("OutboundLink")],1),t._v("。")]),t._v(" "),n("p",[n("storge",[t._v("注意:1.Call Stack 调用栈空闲 -> 2.尝试 DOM 渲染 -> 触发 Event loop。")])],1),t._v(" "),n("ul",[n("li",[n("p",[t._v("每次 Call Stack 清空(即每次轮询结束),即同步任务执行完。")])]),t._v(" "),n("li",[n("p",[t._v("都是 DOM 重新渲染的机会,DOM 结构有改变则重新渲染。")])]),t._v(" "),n("li",[n("p",[t._v("然后再去触发下一次 Event loop。")])])]),t._v(" "),n("p",[t._v("宏任务:setTimeout,setInterval,Ajax,DOM 事件。 微任务:Promise async/await。")]),t._v(" "),n("p",[t._v("两者区别:")]),t._v(" "),n("ul",[n("li",[n("p",[t._v("宏任务:DOM 渲染后触发,如 setTimeout 、setInterval 、DOM 事件 、script 。")])]),t._v(" "),n("li",[n("p",[t._v("微任务:DOM 渲染前触发,如 Promise.then 、MutationObserver 、Node 环境下的 process.nextTick 。")])])]),t._v(" "),n("p",[t._v("从 event loop 解释,为何微任务执行更早?")]),t._v(" "),n("ul",[n("li",[n("p",[t._v("微任务是 ES6 语法规定的(被压入 micro task queue)。")])]),t._v(" "),n("li",[n("p",[t._v("宏任务是由浏览器规定的(通过 Web APIs 压入 Callback queue)。")])]),t._v(" "),n("li",[n("p",[t._v("宏任务执行时间一般比较长。")])]),t._v(" "),n("li",[n("p",[t._v("每一次宏任务开始之前一定是伴随着一次 event loop 结束的,而微任务是在一次 event loop 结束前执行的。")])])]),t._v(" "),n("h2",{attrs:{id:"二、promise"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#二、promise"}},[t._v("#")]),t._v(" 二、Promise")]),t._v(" "),n("p",[t._v("关于这一块儿没什么好说的,最好是实现一遍 Promise A+ 规范,多少有点印象,当然面试官也不会叫你默写一个完整的出来,但是你起码要知道实现原理。")]),t._v(" "),n("blockquote",[n("p",[t._v("关于 Promise 的所有使用方式,可参照这篇文章:"),n("code",[t._v("ECMAScript 6 入门 - Promise 对象")]),t._v("。\n手写 Promise 源码的解析文章,可阅读此篇文章:"),n("code",[t._v("从一道让我失眠的 Promise 面试题开始,深入分析 Promise 实现细节")]),t._v("。\n关于 Promise 的面试题,可参考这篇文章:"),n("code",[t._v("要就来 45 道 Promise 面试题一次爽到底")]),t._v("。")])]),t._v(" "),n("p",[t._v("手写 Promise")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyPromise")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" pending "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"pending"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" fulfilled "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fulfilled"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("static")]),t._v(" rejected "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"rejected"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("constructor")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("executor")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("_isFunction")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("executor"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throw")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token template-string"}},[n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("executor"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v(" is not a function")]),n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pending"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_state "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("undefined")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_handleFulfilled "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_handleRejected "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("executor")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("bind")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("bind")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("_isFunction")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("val")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"[object Function]"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("val")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pending"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fulfilled"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_state "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" cb"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 异步按顺序调用并清空回调")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cb "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_handleFulfilled"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("shift")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("cb")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("val")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pending"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_status "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("rejected"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_state "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" cb"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 异步按顺序调用并清空回调")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cb "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_handleRejected"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("shift")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("cb")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("onFulfilled"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" onRejected")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" self "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" _state"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" _status "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 如果onFulfilled、onRejected不是函数,强制改为函数,并且该函数直接返回接收到的参数,传后面的then的回调函数")]),t._v("\n onFulfilled "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" self"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("_isFunction")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("onFulfilled"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onFulfilled")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("v")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" v"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n onRejected "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" self"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("_isFunction")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("onRejected"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onRejected")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("v")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" v"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyPromise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fulfilled")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("val")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" res "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("onFulfilled")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("val"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("instanceof")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyPromise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("rejected")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("value")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" res "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("onRejected")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("instanceof")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyPromise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 这里是重点")]),t._v("\n res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 注意这里是resolve(res),而不是reject(res)")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("switch")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_status"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pending"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n self"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_handleFulfilled"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fulfilled"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n self"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("_handleRejected"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rejected"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fulfilled"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_state"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" MyPromise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("rejected"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("rejected")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("throw")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Error")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Promise resolver Unverified status"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyPromise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("3000")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("res")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br"),n("span",{staticClass:"line-number"},[t._v("24")]),n("br"),n("span",{staticClass:"line-number"},[t._v("25")]),n("br"),n("span",{staticClass:"line-number"},[t._v("26")]),n("br"),n("span",{staticClass:"line-number"},[t._v("27")]),n("br"),n("span",{staticClass:"line-number"},[t._v("28")]),n("br"),n("span",{staticClass:"line-number"},[t._v("29")]),n("br"),n("span",{staticClass:"line-number"},[t._v("30")]),n("br"),n("span",{staticClass:"line-number"},[t._v("31")]),n("br"),n("span",{staticClass:"line-number"},[t._v("32")]),n("br"),n("span",{staticClass:"line-number"},[t._v("33")]),n("br"),n("span",{staticClass:"line-number"},[t._v("34")]),n("br"),n("span",{staticClass:"line-number"},[t._v("35")]),n("br"),n("span",{staticClass:"line-number"},[t._v("36")]),n("br"),n("span",{staticClass:"line-number"},[t._v("37")]),n("br"),n("span",{staticClass:"line-number"},[t._v("38")]),n("br"),n("span",{staticClass:"line-number"},[t._v("39")]),n("br"),n("span",{staticClass:"line-number"},[t._v("40")]),n("br"),n("span",{staticClass:"line-number"},[t._v("41")]),n("br"),n("span",{staticClass:"line-number"},[t._v("42")]),n("br"),n("span",{staticClass:"line-number"},[t._v("43")]),n("br"),n("span",{staticClass:"line-number"},[t._v("44")]),n("br"),n("span",{staticClass:"line-number"},[t._v("45")]),n("br"),n("span",{staticClass:"line-number"},[t._v("46")]),n("br"),n("span",{staticClass:"line-number"},[t._v("47")]),n("br"),n("span",{staticClass:"line-number"},[t._v("48")]),n("br"),n("span",{staticClass:"line-number"},[t._v("49")]),n("br"),n("span",{staticClass:"line-number"},[t._v("50")]),n("br"),n("span",{staticClass:"line-number"},[t._v("51")]),n("br"),n("span",{staticClass:"line-number"},[t._v("52")]),n("br"),n("span",{staticClass:"line-number"},[t._v("53")]),n("br"),n("span",{staticClass:"line-number"},[t._v("54")]),n("br"),n("span",{staticClass:"line-number"},[t._v("55")]),n("br"),n("span",{staticClass:"line-number"},[t._v("56")]),n("br"),n("span",{staticClass:"line-number"},[t._v("57")]),n("br"),n("span",{staticClass:"line-number"},[t._v("58")]),n("br"),n("span",{staticClass:"line-number"},[t._v("59")]),n("br"),n("span",{staticClass:"line-number"},[t._v("60")]),n("br"),n("span",{staticClass:"line-number"},[t._v("61")]),n("br"),n("span",{staticClass:"line-number"},[t._v("62")]),n("br"),n("span",{staticClass:"line-number"},[t._v("63")]),n("br"),n("span",{staticClass:"line-number"},[t._v("64")]),n("br"),n("span",{staticClass:"line-number"},[t._v("65")]),n("br"),n("span",{staticClass:"line-number"},[t._v("66")]),n("br"),n("span",{staticClass:"line-number"},[t._v("67")]),n("br"),n("span",{staticClass:"line-number"},[t._v("68")]),n("br"),n("span",{staticClass:"line-number"},[t._v("69")]),n("br"),n("span",{staticClass:"line-number"},[t._v("70")]),n("br"),n("span",{staticClass:"line-number"},[t._v("71")]),n("br"),n("span",{staticClass:"line-number"},[t._v("72")]),n("br"),n("span",{staticClass:"line-number"},[t._v("73")]),n("br"),n("span",{staticClass:"line-number"},[t._v("74")]),n("br"),n("span",{staticClass:"line-number"},[t._v("75")]),n("br"),n("span",{staticClass:"line-number"},[t._v("76")]),n("br"),n("span",{staticClass:"line-number"},[t._v("77")]),n("br"),n("span",{staticClass:"line-number"},[t._v("78")]),n("br"),n("span",{staticClass:"line-number"},[t._v("79")]),n("br"),n("span",{staticClass:"line-number"},[t._v("80")]),n("br"),n("span",{staticClass:"line-number"},[t._v("81")]),n("br"),n("span",{staticClass:"line-number"},[t._v("82")]),n("br"),n("span",{staticClass:"line-number"},[t._v("83")]),n("br"),n("span",{staticClass:"line-number"},[t._v("84")]),n("br"),n("span",{staticClass:"line-number"},[t._v("85")]),n("br"),n("span",{staticClass:"line-number"},[t._v("86")]),n("br"),n("span",{staticClass:"line-number"},[t._v("87")]),n("br"),n("span",{staticClass:"line-number"},[t._v("88")]),n("br"),n("span",{staticClass:"line-number"},[t._v("89")]),n("br"),n("span",{staticClass:"line-number"},[t._v("90")]),n("br"),n("span",{staticClass:"line-number"},[t._v("91")]),n("br"),n("span",{staticClass:"line-number"},[t._v("92")]),n("br"),n("span",{staticClass:"line-number"},[t._v("93")]),n("br"),n("span",{staticClass:"line-number"},[t._v("94")]),n("br")])]),n("p",[t._v("实现一个 Promise.all:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[t._v("Promise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("all")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("promises")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Promise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 参数可以不是数组,但必须具有 Iterator 接口")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" promises"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("Symbol"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iterator"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!==")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"function"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Type error"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("promises"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" res "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" count "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" len "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" promises"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" i "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" len"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//考虑到 promises[i] 可能是 thenable 对象也可能是普通值")]),t._v("\n Promise"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("promises"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("data")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),t._v("count "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" len"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("catch")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("err")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("reject")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("err"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br"),n("span",{staticClass:"line-number"},[t._v("24")]),n("br"),n("span",{staticClass:"line-number"},[t._v("25")]),n("br"),n("span",{staticClass:"line-number"},[t._v("26")]),n("br"),n("span",{staticClass:"line-number"},[t._v("27")]),n("br"),n("span",{staticClass:"line-number"},[t._v("28")]),n("br")])]),n("h2",{attrs:{id:"三、async-await-和-promise-的关系"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#三、async-await-和-promise-的关系"}},[t._v("#")]),t._v(" 三、async/await 和 Promise 的关系")]),t._v(" "),n("ul",[n("li",[n("p",[t._v("async/await 是消灭异步回调的终极武器。")])]),t._v(" "),n("li",[n("p",[t._v("但和 Promise 并不互斥,反而,两者相辅相成。")])]),t._v(" "),n("li",[n("p",[t._v("执行 async 函数,返回的一定是 Promise 对象。")])]),t._v(" "),n("li",[n("p",[t._v("await 相当于 Promise 的 then。")])]),t._v(" "),n("li",[n("p",[t._v("try...catch 可捕获异常,代替了 Promise 的 catch。")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/18.5fa4ebb2.js b/assets/js/18.5fa4ebb2.js new file mode 100644 index 0000000..124b120 --- /dev/null +++ b/assets/js/18.5fa4ebb2.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{520:function(t,s,n){t.exports=n.p+"assets/img/base_data.094dbf9d.png"},555:function(t,s,n){"use strict";n.r(s);var a=n(9),e=Object(a.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"一、基本数据类型"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#一、基本数据类型"}},[t._v("#")]),t._v(" 一、基本数据类型")]),t._v(" "),a("hr"),t._v(" "),a("p",[t._v("JS 中七种内置类型(null,undefined,boolean,number,string,symbol,object)又分为两大类型")]),t._v(" "),a("h3",{attrs:{id:"两大类型"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#两大类型"}},[t._v("#")]),t._v(" 两大类型:")]),t._v(" "),a("ul",[a("li",[t._v("基本类型:null,undefined,boolean,number,string,symbol")]),t._v(" "),a("li",[t._v("引用类型 Object:Array,Function,Date,RegExp 等")])]),t._v(" "),a("p",[a("img",{attrs:{src:n(520),alt:"两大基本类型"}})]),t._v(" "),a("h2",{attrs:{id:"二、数据类型的判断"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#二、数据类型的判断"}},[t._v("#")]),t._v(" 二、数据类型的判断")]),t._v(" "),a("ul",[a("li",[t._v("typeof:能判断所有值类型、函数。不可对 null、对象、数组进行精确判断,因为都返回"),a("code",[t._v("object")]),t._v("。")])]),t._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("undefined")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// undefined")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// number")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// boolean")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"str"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// string")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("Symbol")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"foo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// symbol")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2172141653n")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// bigint")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// function")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 不能判别")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// object")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// object")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("typeof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// object")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br"),a("span",{staticClass:"line-number"},[t._v("8")]),a("br"),a("span",{staticClass:"line-number"},[t._v("9")]),a("br"),a("span",{staticClass:"line-number"},[t._v("10")]),a("br"),a("span",{staticClass:"line-number"},[t._v("11")]),a("br")])]),a("ul",[a("li",[t._v("instanceof:能判断对象类型,不能判断基本数据类型,其内部运行机制是判断在其原型链中能否找到该类型的原型。比如考虑以下代码:")])]),t._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("People")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Student")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("People")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" vortesnail "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Student")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("vortesnail "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("instanceof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("People")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// true")]),t._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("vortesnail "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("instanceof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Student")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// true")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br")])]),a("p",[t._v("其实现就是顺着原型链去找,如果能找到对应的 Xxxxx.prototype  即为 true 。比如这里的 vortesnail  作为实例,顺着原型链能找到 Student.prototype  及 People.prototype ,所以都为 true 。")]),t._v(" "),a("ul",[a("li",[t._v("Object.prototype.toString.call():所有原始数据类型都是能判断的,还有 Error 对象,Date 对象等。")])]),t._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Number]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object String]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Boolean]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("undefined")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Undefined]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Null]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Math]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Object]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Array]"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Function]"')]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br"),a("span",{staticClass:"line-number"},[t._v("8")]),a("br"),a("span",{staticClass:"line-number"},[t._v("9")]),a("br")])]),a("p",[t._v("在面试中有一个经常被问的问题就是:如何判断变量是否为数组?")]),t._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[t._v("Array"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("arr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// true")]),t._v("\narr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("__proto__ "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Array")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// true")]),t._v("\narr "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("instanceof")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Array")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// true")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("arr"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// "[object Array]"')]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toRawType")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toString")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("slice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("toLowerCase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br"),a("span",{staticClass:"line-number"},[t._v("8")]),a("br"),a("span",{staticClass:"line-number"},[t._v("9")]),a("br"),a("span",{staticClass:"line-number"},[t._v("10")]),a("br"),a("span",{staticClass:"line-number"},[t._v("11")]),a("br")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/19.0b569402.js b/assets/js/19.0b569402.js new file mode 100644 index 0000000..5914b33 --- /dev/null +++ b/assets/js/19.0b569402.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{523:function(t,s,a){t.exports=a.p+"assets/img/fdjl.d94de3e2.png"},559:function(t,s,a){"use strict";a.r(s);var n=a(9),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"函数防抖和节流"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#函数防抖和节流"}},[t._v("#")]),t._v(" 函数防抖和节流")]),t._v(" "),n("blockquote",[n("p",[t._v("函数的防抖和节流在我们的工作中经常会用到,在面试中页经常出现,因此今天我们来聊聊防抖和节流")])]),t._v(" "),n("p",[t._v("首先我们来看下面这张用竖线画成的图:")]),t._v(" "),n("p",[n("img",{attrs:{src:a(523),alt:'"函数防抖和节流!"'}})]),t._v(" "),n("p",[t._v("这其中的每一条竖线都代表着一次函数调用(如鼠标 mousemove 事件,input 输入事件等)正常执行的时候,调用的频率很快.但有时,我们并不需要这么高的频率去调用这个函数.假如这是一个调用后台接口的操作,那么就容易造成网络堵塞,大大的增加服务器的压力 函数防抖的时候,每次调用事件都是在正常执行暂停后一段时间(等你歇菜了我再上) 函数节流的时候,则是每隔一定的时间间隔就触发一次(管你频率那么快,我就保持自己的节奏) 现在我们大致明白函数的防抖和节流是怎么一回事了,接下来我们就来具体的学习下它们")]),t._v(" "),n("h2",{attrs:{id:"防抖-debounce"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#防抖-debounce"}},[t._v("#")]),t._v(" 防抖(debounce)")]),t._v(" "),n("h3",{attrs:{id:"概念"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#概念"}},[t._v("#")]),t._v(" 概念")]),t._v(" "),n("p",[t._v("在任务频繁触发的情况下,一个事件在被触发的一段时间后再执行回调,假如在这段时间内又被触发了,则重新开始计时。")]),t._v(" "),n("h3",{attrs:{id:"应用场景"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#应用场景"}},[t._v("#")]),t._v(" 应用场景")]),t._v(" "),n("p",[t._v("防抖在我们的日常生活中,也是随处可见.就比如我们平时坐电梯的时候,总是要等到没有人进来了再一小会儿的工夫,电梯门才会关上.而在项目中,防抖的应用场景也是挺多的.当我们在一个搜索框输入内容进行远程搜索的时候,往往就是在我们停下输入的一小刻时间后.前台向服务器发起了请求来获得匹配的结果.我们甚至于可以将防抖的过程,看成一个英雄在技能读条,只有技能读条结束了,技能才能扔出来.要是中途被人打断了,那么下次又要重新读条了。")]),t._v(" "),n("h3",{attrs:{id:"简易版"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#简易版"}},[t._v("#")]),t._v(" 简易版")]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("id")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("ipt1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("value")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br")])]),n("p",[t._v("我们先来看下没有防抖的效果:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" ipt1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#ipt1"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nipt1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onkeydown")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br")])]),n("p",[t._v("再来看一下加了防抖效果的代码:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" ipt1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#ipt1"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nipt1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onkeydown")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("clearTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("timer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("target"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br")])]),n("p",[t._v("大家可以将代码 copy 到编辑器中运行一下看看效果,是不是加了防抖效果的用户体验会更好。")]),t._v(" "),n("h3",{attrs:{id:"函数版"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#函数版"}},[t._v("#")]),t._v(" 函数版")]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("id")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("div1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br")])]),n("div",{staticClass:"language-css line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-css"}},[n("code",[n("span",{pre:!0,attrs:{class:"token selector"}},[t._v("#div1")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v("height")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 300px"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-color")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" orange"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v("overflow")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" auto"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br")])]),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" div1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#div1"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("move")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token template-string"}},[n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offsetX"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v(",")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offsetY"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("debounce")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("fn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wait")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//let that = this;")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" args "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" arguments"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("clearTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("timer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("fn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" args"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wait"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" debounceMove "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("debounce")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("move"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ndiv1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("onmousemove "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" debounceMove"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br")])]),n("p",[t._v("其中"),n("code",[t._v("debounce")]),t._v("就是我们的核心防抖函数了")]),t._v(" "),n("h2",{attrs:{id:"节流-throttle"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#节流-throttle"}},[t._v("#")]),t._v(" 节流(throttle)")]),t._v(" "),n("h3",{attrs:{id:"概念-2"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#概念-2"}},[t._v("#")]),t._v(" 概念")]),t._v(" "),n("p",[t._v("高频事件触发,但是在 n 秒内只会执行一次,会稀释函数的执行频率。")]),t._v(" "),n("h3",{attrs:{id:"应用场景-2"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#应用场景-2"}},[t._v("#")]),t._v(" 应用场景")]),t._v(" "),n("p",[t._v("节流在生活中的实例,就比如看电影的时候,每秒有 24 帧.大概意思就是每一秒钟的电影,其实是给大家播放了 24 张连续的图片.帧数越高,电影看着就越流畅.但是当帧数达到一定的高度时,我们的肉眼已经是看不出区别了.而在项目当中的应用也较多,比如在滚动加载更多的时候,在监听滚动条位置的时候并不是用户每次滚动都要去监听滚动条的位置,而是例如在 1s 内不管滚动多少次,只监听一次滚动条的位置.假如将节流运用到游戏当中,那就相当于技能的 CD,CD 没到,你就是按坏了键盘,技能也放不出来。")]),t._v(" "),n("h3",{attrs:{id:"简易版-2"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#简易版-2"}},[t._v("#")]),t._v(" 简易版")]),t._v(" "),n("div",{staticClass:"language-html line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-html"}},[n("code",[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("id")]),n("span",{pre:!0,attrs:{class:"token attr-value"}},[n("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("div1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("p")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("1"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("p")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("1"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n ...\n"),n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token tag"}},[n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br")])]),n("div",{staticClass:"language-css line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-css"}},[n("code",[n("span",{pre:!0,attrs:{class:"token selector"}},[t._v("#div1")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v("height")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 200px"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-color")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" orange"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token property"}},[t._v("overflow")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" auto"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br")])]),n("p",[t._v("我们先来看下普通的效果,可以看到控制台在疯狂输出:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" div1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#div1"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ndiv1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onscroll")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"我在疯狂输出"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br")])]),n("p",[t._v("再来看下加了节流效果的,控制台每隔一段时间才会打印一次内容:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" div1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#div1"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" flag "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ndiv1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onscroll")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("flag"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n flag "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"我在慢慢输出"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n flag "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br")])]),n("h3",{attrs:{id:"定时器版本"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#定时器版本"}},[t._v("#")]),t._v(" 定时器版本")]),t._v(" "),n("p",[t._v("使用定时器来达到节流的效果:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" div1 "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#div1"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("move")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token template-string"}},[n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offsetX"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v(", ")]),n("span",{pre:!0,attrs:{class:"token interpolation"}},[n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("e"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offsetY"),n("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("throttle")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("fn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("args")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//let that = this;")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("timer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("fn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" args"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" throttleMove "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("throttle")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("move"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\ndiv1"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("onmousemove "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" throttleMove"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br")])]),n("h3",{attrs:{id:"时间戳版本"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#时间戳版本"}},[t._v("#")]),t._v(" 时间戳版本")]),t._v(" "),n("p",[t._v("使用时间戳来达到节流的效果:")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("throttle")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("fn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("args")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" that "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" now "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Date"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("now")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("now "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" time "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" delay"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("fn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("that"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" args"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" now"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br")])]),n("p",[t._v("这个版本的时间戳节流当我们的鼠标移出监听区域的时候,即停止运行了")]),t._v(" "),n("h3",{attrs:{id:"定时器-时间戳版本"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#定时器-时间戳版本"}},[t._v("#")]),t._v(" 定时器+时间戳版本")]),t._v(" "),n("p",[t._v("下面我们来个加强版本的,这个版本是结合了定时器和时间戳,在我们鼠标移出监听区域后,还会再执行一次函数")]),t._v(" "),n("div",{staticClass:"language-js line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-js"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("throttle")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("fn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" time "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("args")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//let that = this;")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" now "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Date"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("now")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("now "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" time "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" delay"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("fn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" args"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n time "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" now"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("clearTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("timer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("fn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("this")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" args"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n time "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" now"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br")])]),n("h2",{attrs:{id:"react-hook-防抖和节流"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#react-hook-防抖和节流"}},[t._v("#")]),t._v(" react-hook 防抖和节流")]),t._v(" "),n("p",[t._v("防抖:")]),t._v(" "),n("div",{staticClass:"language-jsx line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-jsx"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useDebounceHook")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("debounceValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setDebounceValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useEffect")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setDebounceValue")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("clearTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("timer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" delay"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" debounceValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" debounceText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useDebounceHook")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("2000")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useEffect")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("debounceText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"change"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" debounceText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("debounceText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br")])]),n("p",[t._v("节流:")]),t._v(" "),n("div",{staticClass:"language-jsx line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-jsx"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useThrottleValue")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" duration")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("throttleValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setThrottleValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" Local "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useRef")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("flag")]),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("current"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useEffect")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" timer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Local"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("flag"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n Local"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("flag "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setThrottleValue")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Local"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("flag "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" duration"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n timer "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("setThrottleValue")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" duration"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("clearTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("timer"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" duration"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Local"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" throttleValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" setValue"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useState")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" debounceText "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useThrottleValue")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("2000")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("useEffect")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("debounceText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length "),n("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[t._v('"change"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" debounceText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("debounceText"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),t._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[t._v("1")]),n("br"),n("span",{staticClass:"line-number"},[t._v("2")]),n("br"),n("span",{staticClass:"line-number"},[t._v("3")]),n("br"),n("span",{staticClass:"line-number"},[t._v("4")]),n("br"),n("span",{staticClass:"line-number"},[t._v("5")]),n("br"),n("span",{staticClass:"line-number"},[t._v("6")]),n("br"),n("span",{staticClass:"line-number"},[t._v("7")]),n("br"),n("span",{staticClass:"line-number"},[t._v("8")]),n("br"),n("span",{staticClass:"line-number"},[t._v("9")]),n("br"),n("span",{staticClass:"line-number"},[t._v("10")]),n("br"),n("span",{staticClass:"line-number"},[t._v("11")]),n("br"),n("span",{staticClass:"line-number"},[t._v("12")]),n("br"),n("span",{staticClass:"line-number"},[t._v("13")]),n("br"),n("span",{staticClass:"line-number"},[t._v("14")]),n("br"),n("span",{staticClass:"line-number"},[t._v("15")]),n("br"),n("span",{staticClass:"line-number"},[t._v("16")]),n("br"),n("span",{staticClass:"line-number"},[t._v("17")]),n("br"),n("span",{staticClass:"line-number"},[t._v("18")]),n("br"),n("span",{staticClass:"line-number"},[t._v("19")]),n("br"),n("span",{staticClass:"line-number"},[t._v("20")]),n("br"),n("span",{staticClass:"line-number"},[t._v("21")]),n("br"),n("span",{staticClass:"line-number"},[t._v("22")]),n("br"),n("span",{staticClass:"line-number"},[t._v("23")]),n("br")])]),n("blockquote",[n("p",[t._v("总结: 防抖和节流都是为了限制函数的执行频率,以优化函数触发频率过高导致的响应速度跟不上,延迟假死或卡顿的现象")]),t._v(" "),n("ul",[n("li",[t._v("函数防抖:原理是维护一个计时器,在规定时间后执行回调.若在此期间再次触发,则重新开始计时")]),t._v(" "),n("li",[t._v("函数节流:原理是判断是否达到规定时间")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/20.c280ca61.js b/assets/js/20.c280ca61.js new file mode 100644 index 0000000..33f467b --- /dev/null +++ b/assets/js/20.c280ca61.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{529:function(_,v,t){_.exports=t.p+"assets/img/status.78d4d753.png"},564:function(_,v,t){"use strict";t.r(v);var i=t(9),l=Object(i.a)({},(function(){var _=this,v=_.$createElement,i=_._self._c||v;return i("ContentSlotsDistributor",{attrs:{"slot-key":_.$parent.slotKey}},[i("p",[i("img",{attrs:{src:t(529),alt:"HTTP 常见的状态码",title:"HTTP 常见的状态码"}})]),_._v(" "),i("h2",{attrs:{id:"一、是什么"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#一、是什么"}},[_._v("#")]),_._v(" 一、是什么")]),_._v(" "),i("hr"),_._v(" "),i("p",[_._v("HTTP 状态码(英语:HTTP Status Code),用以表示网页服务超文本传输协议响应状态的 3 为数字代码")]),_._v(" "),i("p",[_._v("它由 RFC2616 规范定义的,并得到"),i("code",[_._v("RFC 2518")]),_._v("、"),i("code",[_._v("RFC 2817")]),_._v("、"),i("code",[_._v("RFC 2295")]),_._v("、"),i("code",[_._v("RFC 2774")]),_._v("与 "),i("code",[_._v("RFC 4918")]),_._v("等规范扩展")]),_._v(" "),i("p",[_._v("简单来讲,"),i("code",[_._v("http")]),_._v("状态码的作用是服务器告诉客户端当前请求响应的状态,通过状态码就能判断和分析服务器的运行状态")]),_._v(" "),i("h2",{attrs:{id:"二、分类"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#二、分类"}},[_._v("#")]),_._v(" 二、分类")]),_._v(" "),i("hr"),_._v(" "),i("p",[_._v("状态码第一位数字决定了不同的响应状态,有如下:")]),_._v(" "),i("ul",[i("li",[_._v("1 表示消息")]),_._v(" "),i("li",[_._v("2 表示成功")]),_._v(" "),i("li",[_._v("3 表示重定向")]),_._v(" "),i("li",[_._v("4 表示请求错误")]),_._v(" "),i("li",[_._v("5 表示服务器错误")])]),_._v(" "),i("h3",{attrs:{id:"_1xx"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1xx"}},[_._v("#")]),_._v(" 1xx")]),_._v(" "),i("p",[_._v("代表请求已被接受,需要继续处理。这类响应是临时响应,只包含状态行和某些可选的响应头信息,并以空行结束")]),_._v(" "),i("p",[_._v("常见的有:")]),_._v(" "),i("ul",[i("li",[_._v("100(客户端继续发送请求,这是临时响应):这个临时响应是用来通知客户端它的部分请求已经被服务器接收,且仍未被拒绝。客户端应当继续发送请求的剩余部分,或者如果请求已经完成,忽略这个响应。服务器必须在请求完成后向客户端发送一个最终响应")]),_._v(" "),i("li",[_._v("101:服务器根据客户端的请求切换协议,主要用于 websocket 或 http2 升级")])]),_._v(" "),i("h3",{attrs:{id:"_2xx"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2xx"}},[_._v("#")]),_._v(" 2xx")]),_._v(" "),i("p",[_._v("代表请求已成功被服务器接收、理解、并接受")]),_._v(" "),i("p",[_._v("常见的有:")]),_._v(" "),i("ul",[i("li",[_._v("200(成功):请求已成功,请求所希望的响应头或数据体将随此响应返回")]),_._v(" "),i("li",[_._v("201(已创建):请求成功并且服务器创建了新的资源")]),_._v(" "),i("li",[_._v("202(已创建):服务器已经接收请求,但尚未处理")]),_._v(" "),i("li",[_._v("203(非授权信息):服务器已成功处理请求,但返回的信息可能来自另一来源")]),_._v(" "),i("li",[_._v("204(无内容):服务器成功处理请求,但没有返回任何内容")]),_._v(" "),i("li",[_._v("205(重置内容):服务器成功处理请求,但没有返回任何内容")]),_._v(" "),i("li",[_._v("206(部分内容):服务器成功处理了部分请求")])]),_._v(" "),i("h3",{attrs:{id:"_3xx"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3xx"}},[_._v("#")]),_._v(" 3xx")]),_._v(" "),i("p",[_._v("表示要完成请求,需要进一步操作。 通常,这些状态代码用来重定向")]),_._v(" "),i("p",[_._v("常见的有:")]),_._v(" "),i("ul",[i("li",[_._v("300(多种选择):针对请求,服务器可执行多种操作。 服务器可根据请求者 (user agent) 选择一项操作,或提供操作列表供请求者选择")]),_._v(" "),i("li",[_._v("301(永久移动):请求的网页已永久移动到新位置。 服务器返回此响应(对 GET 或 HEAD 请求的响应)时,会自动将请求者转到新位置")]),_._v(" "),i("li",[_._v("302(临时移动): 服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求")]),_._v(" "),i("li",[_._v("303(查看其他位置):请求者应当对不同的位置使用单独的 GET 请求来检索响应时,服务器返回此代码")]),_._v(" "),i("li",[_._v("305 (使用代理): 请求者只能使用代理访问请求的网页。 如果服务器返回此响应,还表示请求者应使用代理")]),_._v(" "),i("li",[_._v("307 (临时重定向): 服务器目前从不同位置的网页响应请求,但请求者应继续使用原有位置来进行以后的请求")])]),_._v(" "),i("h3",{attrs:{id:"_4xx"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4xx"}},[_._v("#")]),_._v(" 4xx")]),_._v(" "),i("p",[_._v("代表了客户端看起来可能发生了错误,妨碍了服务器的处理")]),_._v(" "),i("p",[_._v("常见的有:")]),_._v(" "),i("ul",[i("li",[_._v("400(错误请求): 服务器不理解请求的语法")]),_._v(" "),i("li",[_._v("401(未授权): 请求要求身份验证。 对于需要登录的网页,服务器可能返回此响应。")]),_._v(" "),i("li",[_._v("403(禁止): 服务器拒绝请求")]),_._v(" "),i("li",[_._v("404(未找到): 服务器找不到请求的资源")]),_._v(" "),i("li",[_._v("405(方法禁用): 禁用请求中指定的方法")]),_._v(" "),i("li",[_._v("406(不接受): 无法使用请求的内容特性响应请求的网页")]),_._v(" "),i("li",[_._v("407(需要代理授权): 此状态代码与 401(未授权)类似,但指定请求者应当授权使用代理")]),_._v(" "),i("li",[_._v("408(请求超时): 服务器等候请求时发生超时")])]),_._v(" "),i("h3",{attrs:{id:"_5xx"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5xx"}},[_._v("#")]),_._v(" 5xx")]),_._v(" "),i("p",[_._v("表示服务器无法完成明显有效的请求。这类状态码代表了服务器在处理请求的过程中有错误或者异常状态发生")]),_._v(" "),i("p",[_._v("常见的有:")]),_._v(" "),i("ul",[i("li",[_._v("500(服务器内部错误):服务器遇到错误,无法完成请求")]),_._v(" "),i("li",[_._v("501(尚未实施):服务器不具备完成请求的功能。 例如,服务器无法识别请求方法时可能会返回此代码")]),_._v(" "),i("li",[_._v("502(错误网关): 服务器作为网关或代理,从上游服务器收到无效响应")]),_._v(" "),i("li",[_._v("503(服务不可用): 服务器目前无法使用(由于超载或停机维护)")]),_._v(" "),i("li",[_._v("504(网关超时): 服务器作为网关或代理,但是没有及时从上游服务器收到请求")]),_._v(" "),i("li",[_._v("505(HTTP 版本不受支持): 服务器不支持请求中所用的 HTTP 协议版本")])]),_._v(" "),i("h2",{attrs:{id:"三、适用场景"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#三、适用场景"}},[_._v("#")]),_._v(" 三、适用场景")]),_._v(" "),i("hr"),_._v(" "),i("p",[_._v("下面给出一些状态码的适用场景:")]),_._v(" "),i("ul",[i("li",[_._v("100:客户端在发送 POST 数据给服务器前,征询服务器情况,看服务器是否处理 POST 的数据,如果不处理,客户端则不上传 POST 数据,如果处理,则 POST 上传数据。常用于 POST 大数据传输")]),_._v(" "),i("li",[_._v("206:一般用来做断点续传,或者是视频文件等大文件的加载")]),_._v(" "),i("li",[_._v("301:永久重定向会缓存。新域名替换旧域名,旧的域名不再使用时,用户访问旧域名时用 301 就重定向到新的域名")]),_._v(" "),i("li",[_._v("302:临时重定向不会缓存,常用 于未登陆的用户访问用户中心重定向到登录页面")]),_._v(" "),i("li",[_._v("304:协商缓存,告诉客户端有缓存,直接使用缓存中的数据,返回页面的只有头部信息,是没有内容部分")]),_._v(" "),i("li",[_._v("400:参数有误,请求无法被服务器识别")]),_._v(" "),i("li",[_._v("403:告诉客户端进制访问该站点或者资源,如在外网环境下,然后访问只有内网 IP 才能访问的时候则返回")]),_._v(" "),i("li",[_._v("404:服务器找不到资源时,或者服务器拒绝请求又不想说明理由时")]),_._v(" "),i("li",[_._v("503:服务器停机维护时,主动用 503 响应请求或 nginx 设置限速,超过限速,会返回 503")]),_._v(" "),i("li",[_._v("504:网关超时")])])])}),[],!1,null,null,null);v.default=l.exports}}]); \ No newline at end of file diff --git a/assets/js/21.de804318.js b/assets/js/21.de804318.js new file mode 100644 index 0000000..5b74091 --- /dev/null +++ b/assets/js/21.de804318.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{531:function(s,a){s.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0QTY4M0Y1MjI1NTMxMUVCQkM4MUUxNkU2OTNCRjZDNiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0QTY4M0Y1MzI1NTMxMUVCQkM4MUUxNkU2OTNCRjZDNiI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjRBNjgzRjUwMjU1MzExRUJCQzgxRTE2RTY5M0JGNkM2IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjRBNjgzRjUxMjU1MzExRUJCQzgxRTE2RTY5M0JGNkM2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+tQxJrQAAAcNJREFUeNrsmr9Kw1AUxk0oqNBFp4IIQpciTh3cdZA66SwOVR/AvoG+QcG97opD/yxOAUERR9GhiyhCoZO6iVP8DiQgoTHJzU1zTzgffASS3Jv7S845ubep5bruTBFUCu4YfX5Pg+wH3oevlhbmtXRo53QDZ+FLuKWrQzvHaLDgNiKAbHMG8UVP5QIwc6nuSjDZJ+TIM9zRNOgjeC3k2C28g5z5yAqkh853wzrA+Umu16XB/nN8CG/jem8cQ+uvavA9bk6dOwipAt8ApsEdhFSGB4A55A7iv6w7gDnlDuLrBDDncIk7COnAC7UydxBSwysCFe4gpLpXnmvcQUgr8F0RQEiLkeuRjOXAXwrtNuHlRAurjHUW3BFnYYWc6EaBcA2t4oKkCi088nVs9hSaPmlc42jJkVX4WKFdzzSQd29QSfVgVGih4jgIL0eSXUAEJLT8NrFx05h+tfHclCeiofxewxuaxjLMs/yOERLjlH1IskuOTKhaNNfaUmj6Ag9MSnaa/bYVJ41GgdAngEeFdq+mTRr7CK++JLuACIiACEgW5beKEtvKagAxvwpXo06I83naSOEdZkmOCMgUZBXlj2e/AgwAspqoOu4/ziUAAAAASUVORK5CYII="},568:function(s,a,t){"use strict";t.r(a);var e=t(9),n=Object(e.a)({},(function(){var s=this,a=s.$createElement,e=s._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[e("blockquote",[e("p",[s._v("Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档")])]),s._v(" "),e("h2",{attrs:{id:"标题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#标题"}},[s._v("#")]),s._v(" 标题")]),s._v(" "),e("p",[s._v("使用"),e("code",[s._v("#")]),s._v("号可表示 1-6 级标题,一级标题对应一个"),e("code",[s._v("#")]),s._v("号,二级标题对应两个"),e("code",[s._v("#")]),s._v("号,以此类推。")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("# 一级标题\n## 二级标题\n### 三级标题\n#### 四级标题\n##### 五级标题\n###### 六级标题\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br")])]),e("p",[s._v("效果如下:")]),s._v(" "),e("h1",{attrs:{id:"一级标题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一级标题"}},[s._v("#")]),s._v(" 一级标题")]),s._v(" "),e("h2",{attrs:{id:"二级标题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二级标题"}},[s._v("#")]),s._v(" 二级标题")]),s._v(" "),e("h3",{attrs:{id:"三级标题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三级标题"}},[s._v("#")]),s._v(" 三级标题")]),s._v(" "),e("h4",{attrs:{id:"四级标题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#四级标题"}},[s._v("#")]),s._v(" 四级标题")]),s._v(" "),e("h5",{attrs:{id:"五级标题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#五级标题"}},[s._v("#")]),s._v(" 五级标题")]),s._v(" "),e("h6",{attrs:{id:"六级标题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#六级标题"}},[s._v("#")]),s._v(" 六级标题")]),s._v(" "),e("p",[s._v("也可以使用"),e("code",[s._v("==")]),s._v("来表示 1 级标题,"),e("code",[s._v("__")]),s._v("来表示 2 级标题")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("这是一级标题\n==\n这是二级标题\n--\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br")])]),e("p",[s._v("效果如下:")]),s._v(" "),e("h1",{attrs:{id:"一级标题-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一级标题-2"}},[s._v("#")]),s._v(" 一级标题")]),s._v(" "),e("h2",{attrs:{id:"二级标题-2"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二级标题-2"}},[s._v("#")]),s._v(" 二级标题")]),s._v(" "),e("h2",{attrs:{id:"字体"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#字体"}},[s._v("#")]),s._v(" 字体")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("*我是斜体*\n_我是斜体_\n**我是粗体**\n__我是粗体__\n***我是粗斜体***\n___我是粗斜体___\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br")])]),e("p",[e("em",[s._v("我是斜体")])]),s._v(" "),e("p",[e("em",[s._v("我是斜体")])]),s._v(" "),e("p",[e("strong",[s._v("我是粗体")])]),s._v(" "),e("p",[e("strong",[s._v("我是粗体")])]),s._v(" "),e("p",[e("strong",[e("em",[s._v("我是粗斜体")])])]),s._v(" "),e("p",[e("strong",[e("em",[s._v("我是粗斜体")])])]),s._v(" "),e("h2",{attrs:{id:"线条"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#线条"}},[s._v("#")]),s._v(" 线条")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("~~我是删除~~\n这是一条下划线\n这是一条分割线\n***\n这是一条分割线\n* * *\n这是一条分割线\n- - -\n这是一条分割线\n--------\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br"),e("span",{staticClass:"line-number"},[s._v("7")]),e("br"),e("span",{staticClass:"line-number"},[s._v("8")]),e("br"),e("span",{staticClass:"line-number"},[s._v("9")]),e("br"),e("span",{staticClass:"line-number"},[s._v("10")]),e("br")])]),e("p",[e("s",[s._v("我是删除")])]),s._v(" "),e("p",[e("u",[s._v("这是一条下划线")])]),s._v(" "),e("p",[s._v("这是一条分割线")]),s._v(" "),e("hr"),s._v(" "),e("p",[s._v("这是一条分割线")]),s._v(" "),e("hr"),s._v(" "),e("p",[s._v("这是一条分割线")]),s._v(" "),e("hr"),s._v(" "),e("h2",{attrs:{id:"这是一条分割线"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#这是一条分割线"}},[s._v("#")]),s._v(" 这是一条分割线")]),s._v(" "),e("p",[e("strong",[s._v("注意:")]),s._v("三个或三个以上的"),e("code",[s._v("-")]),s._v("或"),e("code",[s._v("*")])]),s._v(" "),e("h2",{attrs:{id:"列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#列表"}},[s._v("#")]),s._v(" 列表")]),s._v(" "),e("h3",{attrs:{id:"无序列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#无序列表"}},[s._v("#")]),s._v(" 无序列表")]),s._v(" "),e("p",[s._v("使用"),e("code",[s._v("+")]),s._v(", "),e("code",[s._v("-")]),s._v(", "),e("code",[s._v("*")]),s._v(" 其中任何一个作为标记")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("* list1\n+ list2\n- list3\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br")])]),e("ul",[e("li",[s._v("list1")]),s._v(" "),e("li",[s._v("list2")]),s._v(" "),e("li",[s._v("list3")])]),s._v(" "),e("h3",{attrs:{id:"有序列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#有序列表"}},[s._v("#")]),s._v(" 有序列表")]),s._v(" "),e("p",[s._v("使用数字 + "),e("code",[s._v(".")]),s._v("来表示")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("1. list1\n2. list2\n3. list3\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br")])]),e("ol",[e("li",[s._v("list1")]),s._v(" "),e("li",[s._v("list2")]),s._v(" "),e("li",[s._v("list3")])]),s._v(" "),e("h3",{attrs:{id:"列表嵌套"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#列表嵌套"}},[s._v("#")]),s._v(" 列表嵌套")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("1. list1\n - list1-1\n - list1-2\n2. list2\n - list2-1\n - list2-2\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br")])]),e("ol",[e("li",[s._v("list1")])]),s._v(" "),e("ul",[e("li",[s._v("list1-1")]),s._v(" "),e("li",[s._v("list1-2")])]),s._v(" "),e("ol",{attrs:{start:"2"}},[e("li",[s._v("list2")])]),s._v(" "),e("ul",[e("li",[s._v("list2-1")]),s._v(" "),e("li",[s._v("list2-2")])]),s._v(" "),e("h3",{attrs:{id:"任务列表"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#任务列表"}},[s._v("#")]),s._v(" 任务列表")]),s._v(" "),e("p",[e("strong",[s._v("注:")]),s._v("此种写法在 vuepress 中无效,可以使用原生的复选框代替")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("- [ ] 吃饭\n- [x] 睡觉 //打x的表示已完成\n- [ ] 打豆豆\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br")])]),e("ul",[e("li",[s._v("[ ] 吃饭")]),s._v(" "),e("li",[s._v("[x] 睡觉 //打 x 的表示已完成")]),s._v(" "),e("li",[s._v("[ ] 打豆豆")])]),s._v(" "),e("div",{staticClass:"language-HTML line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("label")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("input")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[s._v("type")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[s._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')]),s._v("checkbox"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("吃饭"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("")])]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("label")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("input")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[s._v("type")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[s._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')]),s._v("checkbox"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')])]),s._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[s._v("checked")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("睡觉"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("")])]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("label")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("input")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token attr-name"}},[s._v("type")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[s._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')]),s._v("checkbox"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("打豆豆"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("")])]),s._v("\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br")])]),e("p",[e("label",[e("input",{attrs:{type:"checkbox"}}),s._v("吃饭")]),s._v(" "),e("label",[e("input",{attrs:{type:"checkbox",checked:""}}),s._v("睡觉")]),s._v(" "),e("label",[e("input",{attrs:{type:"checkbox"}}),s._v("打豆豆")])]),s._v(" "),e("h3",{attrs:{id:"引用"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#引用"}},[s._v("#")]),s._v(" 引用")]),s._v(" "),e("p",[s._v("可以无限引用,但是没什么太大的意义")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("> 前言:第一层引用\n>> 前言:第二层引用\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br")])]),e("blockquote",[e("p",[s._v("前言:第一层引用")]),s._v(" "),e("blockquote",[e("p",[s._v("前言:第二层引用")])])]),s._v(" "),e("h3",{attrs:{id:"链接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#链接"}},[s._v("#")]),s._v(" 链接")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("[百度](https://www.baidu.com)\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("p",[e("a",{attrs:{href:"https://www.baidu.com",target:"_blank",rel:"noopener noreferrer"}},[s._v("百度"),e("OutboundLink")],1)]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("p",[e("a",{attrs:{href:"https://www.baidu.com",target:"_blank",rel:"noopener noreferrer"}},[s._v("https://www.baidu.com"),e("OutboundLink")],1)]),s._v(" "),e("h3",{attrs:{id:"图片"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#图片"}},[s._v("#")]),s._v(" 图片")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v('![alt 属性文本](图片链接)\n![占位符](https://iph.href.lu/200x200)\t//在线图片\n![占位符](/achievements-icon.png "测试")\t//本地图片\n')])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br")])]),e("p",[e("img",{attrs:{src:"https://iph.href.lu/200x200",alt:"占位符"}}),s._v(" "),e("img",{attrs:{src:t(531),alt:"占位符"}})]),s._v(" "),e("h2",{attrs:{id:"表格"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#表格"}},[s._v("#")]),s._v(" 表格")]),s._v(" "),e("p",[s._v("Markdown 使用 | 来分隔不同单元格,使用 - 来分隔表头和主体")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("|标题1|标题2|标题2\n| :- | :-: | -:\n|行1列1|行1列2|行1列3\n|行2列1|行2列2|行2列3\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br")])]),e("table",[e("thead",[e("tr",[e("th",{staticStyle:{"text-align":"left"}},[s._v("标题 1")]),s._v(" "),e("th",{staticStyle:{"text-align":"center"}},[s._v("标题 2")]),s._v(" "),e("th",{staticStyle:{"text-align":"right"}},[s._v("标题 2")])])]),s._v(" "),e("tbody",[e("tr",[e("td",{staticStyle:{"text-align":"left"}},[s._v("行 1 列 1")]),s._v(" "),e("td",{staticStyle:{"text-align":"center"}},[s._v("行 1 列 2")]),s._v(" "),e("td",{staticStyle:{"text-align":"right"}},[s._v("行 1 列 3")])]),s._v(" "),e("tr",[e("td",{staticStyle:{"text-align":"left"}},[s._v("行 2 列 1")]),s._v(" "),e("td",{staticStyle:{"text-align":"center"}},[s._v("行 2 列 2")]),s._v(" "),e("td",{staticStyle:{"text-align":"right"}},[s._v("行 2 列 3")])])])]),s._v(" "),e("h2",{attrs:{id:"代码"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#代码"}},[s._v("#")]),s._v(" 代码")]),s._v(" "),e("h3",{attrs:{id:"单行代码"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#单行代码"}},[s._v("#")]),s._v(" 单行代码")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("(```)\nconsole.log(1)\n(```)\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br")])]),e("p",[s._v("这里在几个平台测试了一下,发现有的能显示,有的不能显示,所以这里在 ```外面包裹一层()只用于展示使用 效果如下:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("console.log(1)\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("p",[s._v("或者直接使用 4 个空格,也是可以展示一个代码片段")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("console.log(1)\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"流程图"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#流程图"}},[s._v("#")]),s._v(" 流程图")]),s._v(" "),e("p",[s._v("Markdown 还支持流程图或甘特图之类的.但是因为不同的平台对其支持都是不同的,有的支持,有的不支持,因此就不展示流程图的代码了。")]),s._v(" "),e("h2",{attrs:{id:"兼容-html"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#兼容-html"}},[s._v("#")]),s._v(" 兼容 HTML")]),s._v(" "),e("p",[s._v("Markdown 的目标是成为一种适用于网络的书写语言.它的标签较少,只对应了 HTML 中的一部分.不在其覆盖范围内的,我们可以使用 html 标签来书写.(貌似也有的平台是不支持的)")]),s._v(" "),e("div",{staticClass:"language-HTML line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-html"}},[e("code",[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("<")]),s._v("span")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token special-attr"}},[e("span",{pre:!0,attrs:{class:"token attr-name"}},[s._v("style")]),e("span",{pre:!0,attrs:{class:"token attr-value"}},[e("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[s._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')]),e("span",{pre:!0,attrs:{class:"token value css language-css"}},[e("span",{pre:!0,attrs:{class:"token property"}},[s._v("color")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v("orange"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v('"')])])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(">")])]),s._v("orange"),e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token tag"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("")])]),s._v("\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("p",[s._v("效果如下:")]),s._v(" "),e("p",[e("span",{staticStyle:{color:"orange"}},[s._v("orange")])]),s._v(" "),e("p",[s._v("使用"),e("code",[s._v("kbd")]),s._v("来展示按键:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("Ctrl+S\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("p",[e("kbd",[s._v("Ctrl")]),s._v("+"),e("kbd",[s._v("S")]),s._v("来保存文档")]),s._v(" "),e("p",[s._v("使用反斜杠转义特殊字符:")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("\\*\\* 正常显示 \\*\\*\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("p",[s._v("** 正常显示 **")]),s._v(" "),e("h2",{attrs:{id:"注解"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#注解"}},[s._v("#")]),s._v(" 注解")]),s._v(" "),e("p",[s._v("使用"),e("code",[s._v("[^]")]),s._v("来定义注解:("),e("span",{staticStyle:{color:"#ff0000"}},[s._v("vuepress")]),s._v("中无效)")]),s._v(" "),e("div",{staticClass:"language- line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[s._v("我是一个注解[^注解1]\n我也是一个注解[^注解2]\n去[百度][1]\n\n[^注解1]:我是注解1\n\n[^注解2]:我是注解2\n[1]: http://www.baidu.com\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br"),e("span",{staticClass:"line-number"},[s._v("7")]),e("br"),e("span",{staticClass:"line-number"},[s._v("8")]),e("br")])]),e("p",[s._v("效果如下:")]),s._v(" "),e("p",[s._v("我是一个注解[^注解1]"),e("br"),s._v("\n我也是一个注解[^注解2]"),e("br"),s._v("\n去"),e("a",{attrs:{href:"http://www.google.com",target:"_blank",rel:"noopener noreferrer"}},[s._v("Google"),e("OutboundLink")],1)]),s._v(" "),e("p",[s._v("[^注解1]: 我是注解 1\n[^注解2]: 我是注解 2")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/22.d6e285b7.js b/assets/js/22.d6e285b7.js new file mode 100644 index 0000000..32992f7 --- /dev/null +++ b/assets/js/22.d6e285b7.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{530:function(s,t,a){s.exports=a.p+"assets/img/SPA.bb5b901f.png"},567:function(s,t,a){"use strict";a.r(t);var e=a(9),n=Object(e.a)({},(function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[e("h2",{attrs:{id:"一、什么是首屏加载"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、什么是首屏加载"}},[s._v("#")]),s._v(" 一、什么是首屏加载")]),s._v(" "),e("hr"),s._v(" "),e("p",[s._v("首屏时间(First Contentful Paint),指的是浏览器从响应用户输入网址地址,到首屏内容渲染完成的时间,此时整个网页不一样要全部渲染完成,但需要展示当前视窗需要的内容")]),s._v(" "),e("p",[s._v("首屏加载可以说是用户体验中重要的环节。")]),s._v(" "),e("h2",{attrs:{id:"二、加载慢的原因"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、加载慢的原因"}},[s._v("#")]),s._v(" 二、加载慢的原因")]),s._v(" "),e("hr"),s._v(" "),e("p",[s._v("在页面渲染的过程,导致加载速度慢的因素可能如下:")]),s._v(" "),e("ul",[e("li",[s._v("网络延时问题")]),s._v(" "),e("li",[s._v("资源文件体积是否过大")]),s._v(" "),e("li",[s._v("资源是否重发发送请求去加载了")]),s._v(" "),e("li",[s._v("加载脚本的时候,渲染内容堵塞")])]),s._v(" "),e("h2",{attrs:{id:"三、解决方案"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#三、解决方案"}},[s._v("#")]),s._v(" 三、解决方案")]),s._v(" "),e("hr"),s._v(" "),e("p",[s._v("常见的几种 SPA 首屏优化方式")]),s._v(" "),e("ul",[e("li",[s._v("减少入口文件体积")]),s._v(" "),e("li",[s._v("静态资源本地缓存")]),s._v(" "),e("li",[s._v("UI 框架按需加载")]),s._v(" "),e("li",[s._v("图片资源压缩")]),s._v(" "),e("li",[s._v("开启 Gzip 压缩")]),s._v(" "),e("li",[s._v("使用 SSR")])]),s._v(" "),e("h3",{attrs:{id:"减少入口文件体积"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#减少入口文件体积"}},[s._v("#")]),s._v(" 减少入口文件体积")]),s._v(" "),e("ol",[e("li",[s._v("常用的手段是路由懒加载,把不同路由对应的组件分割成不同的代码块,待路由被请求的时候会单独打包路由,使得入口文件变小,加载速度大大增加。")]),s._v(" "),e("li",[s._v("还有就是使用 cdn 加速,减少文件体积,但是要是看别人的 cdn 服务器稳不稳定,也可以自己下载 cdn 放到自己服务器,但是自己服务器没有 cdn 分发的话,速度就会在下载 cdn 文件时候影响加载速度。")])]),s._v(" "),e("h3",{attrs:{id:"静态资源本地缓存"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#静态资源本地缓存"}},[s._v("#")]),s._v(" 静态资源本地缓存")]),s._v(" "),e("hr"),s._v(" "),e("p",[s._v("后端返回的资源问题:")]),s._v(" "),e("ul",[e("li",[s._v("采用"),e("code",[s._v("HTTP")]),s._v("缓存,设置"),e("code",[s._v("Cache-Control")]),s._v(","),e("code",[s._v("Last-Modified")]),s._v(","),e("code",[s._v("Etag")]),s._v("等响应头")]),s._v(" "),e("li",[s._v("采用"),e("code",[s._v("Service Worker")]),s._v("离线缓存\n前端合理使用 LocalStorage")])]),s._v(" "),e("h3",{attrs:{id:"ui-框架按需加载"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ui-框架按需加载"}},[s._v("#")]),s._v(" UI 框架按需加载")]),s._v(" "),e("h3",{attrs:{id:"图片资源的压缩"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#图片资源的压缩"}},[s._v("#")]),s._v(" 图片资源的压缩")]),s._v(" "),e("p",[s._v("图片资源虽然不在编码过程中,但它却是对页面性能影响最大的因素\n对于所有的图片资源,我们可以进行适当的压缩\n对于页面上使用到的 icon,可以使用在线字体图标,或者雪碧图,将众多小图标合并到一张图上,减少"),e("code",[s._v("HTTP")]),s._v("请求次数")]),s._v(" "),e("h3",{attrs:{id:"开启-gzip-压缩"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#开启-gzip-压缩"}},[s._v("#")]),s._v(" 开启 Gzip 压缩")]),s._v(" "),e("p",[s._v("拆完包之后,我们在使用"),e("code",[s._v("Gzip")]),s._v("做一下压缩,安装"),e("code",[s._v("compression-webpack-plugin")])]),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[s._v("yarn")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[s._v("add")]),s._v(" compression-webpack-plugin -D\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("p",[s._v("在"),e("code",[s._v("vue.config.js")]),s._v("中引入并修改"),e("code",[s._v("webpack")]),s._v("配置")]),s._v(" "),e("div",{staticClass:"language-js line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-js"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" CompressionWebpackPlugin "),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[s._v("require")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[s._v('"compression-webpack-plugin"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nmodule"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("exports"),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),e("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//省略")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("configureWebpack")]),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("plugins")]),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("CompressionWebpackPlugin")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("test")]),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),e("span",{pre:!0,attrs:{class:"token regex"}},[e("span",{pre:!0,attrs:{class:"token regex-delimiter"}},[s._v("/")]),e("span",{pre:!0,attrs:{class:"token regex-source language-regex"}},[s._v("\\.(js|css)$")]),e("span",{pre:!0,attrs:{class:"token regex-delimiter"}},[s._v("/")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),e("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//匹配文件名")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("threshold")]),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),e("span",{pre:!0,attrs:{class:"token number"}},[s._v("10240")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),e("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//对超过10k的数据进行压缩")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("minRatio")]),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[s._v("0.8")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 压缩比")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("deleteOriginalAssets")]),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("false")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//是否删除原文件")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("exclude")]),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[s._v('"/node_modules/"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br"),e("span",{staticClass:"line-number"},[s._v("7")]),e("br"),e("span",{staticClass:"line-number"},[s._v("8")]),e("br"),e("span",{staticClass:"line-number"},[s._v("9")]),e("br"),e("span",{staticClass:"line-number"},[s._v("10")]),e("br"),e("span",{staticClass:"line-number"},[s._v("11")]),e("br"),e("span",{staticClass:"line-number"},[s._v("12")]),e("br"),e("span",{staticClass:"line-number"},[s._v("13")]),e("br"),e("span",{staticClass:"line-number"},[s._v("14")]),e("br"),e("span",{staticClass:"line-number"},[s._v("15")]),e("br"),e("span",{staticClass:"line-number"},[s._v("16")]),e("br")])]),e("p",[s._v("在服务器我们也要做相应的配置,比如"),e("code",[s._v("Nginx")])]),s._v(" "),e("div",{staticClass:"language-Nginx line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-nginx"}},[e("code",[e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("on")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_disable")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[s._v('"msie6"')])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_vary")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("on")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_proxied")]),s._v(" any")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_comp_level")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[s._v("6")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_buffers")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[s._v("16")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[s._v("8k")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_http_version")]),s._v(" 1.1")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_min_length")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[s._v("256")])]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token directive"}},[e("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("gzip_types")]),s._v(" application/atom+xml application/geo+json application/javascript application/x-javascript application/json application/ld+json application/manifest+json application/rdf+xml application/rss+xml application/xhtml+xml application/xml font/eot font/otf font/ttf image/svg+xml text/css text/javascript text/plain text/xml")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br"),e("span",{staticClass:"line-number"},[s._v("3")]),e("br"),e("span",{staticClass:"line-number"},[s._v("4")]),e("br"),e("span",{staticClass:"line-number"},[s._v("5")]),e("br"),e("span",{staticClass:"line-number"},[s._v("6")]),e("br"),e("span",{staticClass:"line-number"},[s._v("7")]),e("br"),e("span",{staticClass:"line-number"},[s._v("8")]),e("br"),e("span",{staticClass:"line-number"},[s._v("9")]),e("br")])]),e("h3",{attrs:{id:"使用-ssr"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#使用-ssr"}},[s._v("#")]),s._v(" 使用 SSR")]),s._v(" "),e("p",[s._v("SSR(Server side),也就是服务器渲染,组件或页面通过服务器生成 html 字符串,再发送到浏览器\n从头搭建一个服务器渲染是很复杂的,"),e("code",[s._v("Vue")]),s._v("应用建议使用"),e("code",[s._v("Nuxt.js")]),s._v("实现服务器渲染")]),s._v(" "),e("h3",{attrs:{id:"小结"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#小结"}},[s._v("#")]),s._v(" 小结")]),s._v(" "),e("p",[s._v("减少首屏渲染时间的方法有很多,总的来讲可以分成两大部分,资源加载优化和页面渲染优化")]),s._v(" "),e("p",[s._v("下图是更为全面的首屏优化的方案")]),s._v(" "),e("p",[e("img",{attrs:{src:a(530),alt:"首屏优化",title:"首屏优化"}})]),s._v(" "),e("p",[s._v("大家可以根据自己项目的情况选择各种方式进行首屏渲染的优化")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/23.52a57404.js b/assets/js/23.52a57404.js new file mode 100644 index 0000000..bae77dd --- /dev/null +++ b/assets/js/23.52a57404.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{552:function(s,t,n){"use strict";n.r(t);var a=n(9),e=Object(a.a)({},(function(){var s=this,t=s.$createElement,n=s._self._c||t;return n("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[n("h1",{attrs:{id:"usepromisereadyfn"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#usepromisereadyfn"}},[s._v("#")]),s._v(" usePromiseReadyFn")]),s._v(" "),n("blockquote",[n("p",[s._v("等待数据请求完再接受数据")])]),s._v(" "),n("div",{staticClass:"language-ts line-numbers-mode"},[n("pre",{pre:!0,attrs:{class:"language-ts"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" sleepFn "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("sleep"),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),n("span",{pre:!0,attrs:{class:"token builtin"}},[s._v("number")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),n("span",{pre:!0,attrs:{class:"token builtin"}},[s._v("Promise")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),n("span",{pre:!0,attrs:{class:"token builtin"}},[s._v("number")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[n("span",{pre:!0,attrs:{class:"token builtin"}},[s._v("Promise")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("resolve "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("setTimeout")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("resolve")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("sleep"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("usePromiseReadyFn")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" resolveResolve "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("null")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" promiseResolveFn "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token class-name"}},[n("span",{pre:!0,attrs:{class:"token builtin"}},[s._v("Promise")])]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("resolve "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n resolveResolve "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" resolve"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("promiseReadyFn")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("cb")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("void")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n promiseResolveFn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("then")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("cb")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n promiseResolveFn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n promiseReadyFn\n "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// Demo")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("promiseResolveFn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("promiseReadyFn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" usePromiseReadyFn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("export")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" onReadyFn "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" promiseReadyFn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("request")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("async")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("await")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token builtin"}},[s._v("Promise")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("all")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("sleepFn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("1000")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("sleepFn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("3000")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("sleepFn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[s._v("2000")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("promiseResolveFn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),n("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 其它地方需要用到上面执行完之后才执行获取到的数据")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("import")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("onReadyFn"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("from")]),s._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"*"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("onReadyFn")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),n("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),n("span",{pre:!0,attrs:{class:"token builtin"}},[s._v("console")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),n("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),n("span",{pre:!0,attrs:{class:"token string"}},[s._v('"Ready"')]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n")])]),s._v(" "),n("div",{staticClass:"line-numbers-wrapper"},[n("span",{staticClass:"line-number"},[s._v("1")]),n("br"),n("span",{staticClass:"line-number"},[s._v("2")]),n("br"),n("span",{staticClass:"line-number"},[s._v("3")]),n("br"),n("span",{staticClass:"line-number"},[s._v("4")]),n("br"),n("span",{staticClass:"line-number"},[s._v("5")]),n("br"),n("span",{staticClass:"line-number"},[s._v("6")]),n("br"),n("span",{staticClass:"line-number"},[s._v("7")]),n("br"),n("span",{staticClass:"line-number"},[s._v("8")]),n("br"),n("span",{staticClass:"line-number"},[s._v("9")]),n("br"),n("span",{staticClass:"line-number"},[s._v("10")]),n("br"),n("span",{staticClass:"line-number"},[s._v("11")]),n("br"),n("span",{staticClass:"line-number"},[s._v("12")]),n("br"),n("span",{staticClass:"line-number"},[s._v("13")]),n("br"),n("span",{staticClass:"line-number"},[s._v("14")]),n("br"),n("span",{staticClass:"line-number"},[s._v("15")]),n("br"),n("span",{staticClass:"line-number"},[s._v("16")]),n("br"),n("span",{staticClass:"line-number"},[s._v("17")]),n("br"),n("span",{staticClass:"line-number"},[s._v("18")]),n("br"),n("span",{staticClass:"line-number"},[s._v("19")]),n("br"),n("span",{staticClass:"line-number"},[s._v("20")]),n("br"),n("span",{staticClass:"line-number"},[s._v("21")]),n("br"),n("span",{staticClass:"line-number"},[s._v("22")]),n("br"),n("span",{staticClass:"line-number"},[s._v("23")]),n("br"),n("span",{staticClass:"line-number"},[s._v("24")]),n("br"),n("span",{staticClass:"line-number"},[s._v("25")]),n("br"),n("span",{staticClass:"line-number"},[s._v("26")]),n("br"),n("span",{staticClass:"line-number"},[s._v("27")]),n("br"),n("span",{staticClass:"line-number"},[s._v("28")]),n("br"),n("span",{staticClass:"line-number"},[s._v("29")]),n("br"),n("span",{staticClass:"line-number"},[s._v("30")]),n("br"),n("span",{staticClass:"line-number"},[s._v("31")]),n("br"),n("span",{staticClass:"line-number"},[s._v("32")]),n("br"),n("span",{staticClass:"line-number"},[s._v("33")]),n("br"),n("span",{staticClass:"line-number"},[s._v("34")]),n("br"),n("span",{staticClass:"line-number"},[s._v("35")]),n("br"),n("span",{staticClass:"line-number"},[s._v("36")]),n("br"),n("span",{staticClass:"line-number"},[s._v("37")]),n("br"),n("span",{staticClass:"line-number"},[s._v("38")]),n("br"),n("span",{staticClass:"line-number"},[s._v("39")]),n("br"),n("span",{staticClass:"line-number"},[s._v("40")]),n("br"),n("span",{staticClass:"line-number"},[s._v("41")]),n("br"),n("span",{staticClass:"line-number"},[s._v("42")]),n("br"),n("span",{staticClass:"line-number"},[s._v("43")]),n("br"),n("span",{staticClass:"line-number"},[s._v("44")]),n("br")])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/24.5f6d1afa.js b/assets/js/24.5f6d1afa.js new file mode 100644 index 0000000..a3bbe8b --- /dev/null +++ b/assets/js/24.5f6d1afa.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{557:function(s,t,a){"use strict";a.r(t);var n=a(9),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h2",{attrs:{id:"一、定义"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#一、定义"}},[s._v("#")]),s._v(" 一、定义")]),s._v(" "),a("hr"),s._v(" "),a("p",[s._v("函数的"),a("code",[s._v("this")]),s._v("关键字在"),a("code",[s._v("JavaScript")]),s._v("中的表现略有不同,此外,在严格模式和非严格模式之间也会有一些差别")]),s._v(" "),a("p",[s._v("在绝大多数情况下,函数的调用方式决定了"),a("code",[s._v("this")]),s._v("的值(运行是绑定)")]),s._v(" "),a("p",[a("code",[s._v("this")]),s._v("关键字是函数运行时自动生成的一个内部对象,只能在函数内部使用,总指向调用它的对象")]),s._v(" "),a("p",[s._v("举个例子:")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("baz")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 当前调用栈是:baz")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 因此,当前调用位置是全局作用域")]),s._v("\n\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"baz"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("bar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// <-- bar的调用位置")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("bar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 当前调用栈是:baz --\x3e bar")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 因此,当前调用位置在baz中")]),s._v("\n\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"bar"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// <-- foo的调用位置")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 当前调用栈是:baz --\x3e bar --\x3e foo")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 因此,当前调用位置在bar中")]),s._v("\n\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"foo"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("baz")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// <-- baz的调用位置")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br"),a("span",{staticClass:"line-number"},[s._v("17")]),a("br"),a("span",{staticClass:"line-number"},[s._v("18")]),a("br"),a("span",{staticClass:"line-number"},[s._v("19")]),a("br"),a("span",{staticClass:"line-number"},[s._v("20")]),a("br"),a("span",{staticClass:"line-number"},[s._v("21")]),a("br"),a("span",{staticClass:"line-number"},[s._v("22")]),a("br"),a("span",{staticClass:"line-number"},[s._v("23")]),a("br"),a("span",{staticClass:"line-number"},[s._v("24")]),a("br")])]),a("p",[s._v("同时,"),a("code",[s._v("this")]),s._v("在函数执行中,"),a("code",[s._v("this")]),s._v("一旦呗确定了,就不可以更改")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" a "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("a")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 修改this,运行后会报错")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br")])]),a("h2",{attrs:{id:"二、绑定规则"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#二、绑定规则"}},[s._v("#")]),s._v(" 二、绑定规则")]),s._v(" "),a("hr"),s._v(" "),a("p",[s._v("根据不同的使用场景,"),a("code",[s._v("this")]),s._v("有不同的值,主要分为下面几种情况:")]),s._v(" "),a("ul",[a("li",[s._v("默认绑定")]),s._v(" "),a("li",[s._v("隐式绑定")]),s._v(" "),a("li",[s._v("new 绑定")]),s._v(" "),a("li",[s._v("显示绑定")])]),s._v(" "),a("h3",{attrs:{id:"默认绑定"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#默认绑定"}},[s._v("#")]),s._v(" 默认绑定")]),s._v(" "),a("p",[s._v("全局环境中定义"),a("code",[s._v("person")]),s._v("函数,内部使用"),a("code",[s._v("this")]),s._v("关键字")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" name "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"Jenny"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("person")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("person")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//Jenny")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br")])]),a("p",[s._v("上述代码输出"),a("code",[s._v("Jenny")]),s._v(",原因是调用函数的对象在浏览器中为"),a("code",[s._v("window")]),s._v(",因此"),a("code",[s._v("this")]),s._v("指向"),a("code",[s._v("window")]),s._v(",所以输出"),a("code",[s._v("Jenny")])]),s._v(" "),a("p",[s._v("注意:")]),s._v(" "),a("p",[s._v("严格模式下,不能将全局对象用于默认绑定,this 会绑定到"),a("code",[s._v("undefined")]),s._v(",只有函数运行在非严格模式下,默认绑定才能绑定到全局对象")]),s._v(" "),a("h3",{attrs:{id:"隐式绑定"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#隐式绑定"}},[s._v("#")]),s._v(" 隐式绑定")]),s._v(" "),a("p",[s._v("函数还可以作为某个对象的方法调用,这时"),a("code",[s._v("this")]),s._v("就指这个上级对象")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("test")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("x"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nobj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("x "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nobj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("m "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" test"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\nobj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("m")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 1")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br")])]),a("p",[s._v("这个函数中包含多个对象,尽管这个函数是被最外层的对象调用,"),a("code",[s._v("this")]),s._v("指向的也只是它上一级的对象")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" o "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("a")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("b")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//undefined")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\no"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br")])]),a("p",[s._v("上述代码中,"),a("code",[s._v("this")]),s._v("的上一级对象为"),a("code",[s._v("b")]),s._v(","),a("code",[s._v("b")]),s._v("内部并没有"),a("code",[s._v("a")]),s._v("变量的定义,所以输出"),a("code",[s._v("undefined")])]),s._v(" "),a("p",[s._v("这里再举一个特殊情况")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" o "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("a")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("b")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("a")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("12")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//undefined")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//window")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" j "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" o"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("fn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("j")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br")])]),a("p",[s._v("此时"),a("code",[s._v("this")]),s._v("指向的是"),a("code",[s._v("window")]),s._v(",这里的大家需要记住,"),a("code",[s._v("this")]),s._v("永远指向的是最后调用它的对象,虽然"),a("code",[s._v("fn")]),s._v("是对象"),a("code",[s._v("b")]),s._v("的方法,但是"),a("code",[s._v("fn")]),s._v("赋值给"),a("code",[s._v("j")]),s._v("时候并没有执行,所以最终指向"),a("code",[s._v("window")])]),s._v(" "),a("h3",{attrs:{id:"new-绑定"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-绑定"}},[s._v("#")]),s._v(" new 绑定")]),s._v(" "),a("p",[s._v("通过构建函数"),a("code",[s._v("new")]),s._v("关键字生成一个实例对象,此时"),a("code",[s._v("this")]),s._v("指向这个实例对象")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("test")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("x "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("text")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nobj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("x"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//1")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br")])]),a("p",[s._v("上述代码之所以能过输出 1,是因为"),a("code",[s._v("new")]),s._v("关键字改变了"),a("code",[s._v("this")]),s._v("的指向")]),s._v(" "),a("p",[s._v("这里在列举一些特殊情况:")]),s._v(" "),a("p",[a("code",[s._v("new")]),s._v("过程遇到"),a("code",[s._v("return")]),s._v("一个对象,此时"),a("code",[s._v("this")]),s._v("指向为返回的对象")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("test")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("user "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("test")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("user"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//undefined")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br")])]),a("p",[s._v("如果返回一个简单类型的时候,则"),a("code",[s._v("this")]),s._v("指向实例对象")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("user "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" a "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("user"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//xxx")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br")])]),a("p",[s._v("注意的是"),a("code",[s._v("null")]),s._v("虽然也是对象,但是此时"),a("code",[s._v("new")]),s._v("仍然指向实例对象")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("user "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"xxx"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" a "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("user"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//xxx")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br")])]),a("h3",{attrs:{id:"显示修改"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#显示修改"}},[s._v("#")]),s._v(" 显示修改")]),s._v(" "),a("p",[a("code",[s._v("apply()、call()、bind()")]),s._v("是函数的一个方法,作用是改变函数的调用对象。它的一个参数就表示改变后的调用这个函数的对象。因此,这时"),a("code",[s._v("this")]),s._v("指的就是这第一个参数")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" x "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("test")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("x"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nobj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("x "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("m "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" test"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("m")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("apply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//1")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br")])]),a("h2",{attrs:{id:"三、箭头函数"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#三、箭头函数"}},[s._v("#")]),s._v(" 三、箭头函数")]),s._v(" "),a("hr"),s._v(" "),a("p",[s._v("在 ES6 的语法中还提供了箭头函语法,让我们在代码书写时就能确定 "),a("code",[s._v("this")]),s._v(" 的指向(编译时绑定)")]),s._v(" "),a("p",[s._v("举个例子:")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("sayThis")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\nobj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("sayThis")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// window 因为 JavaScript 没有块作用域,所以在定义 sayThis 的时候,里面的 this 就绑到 window 上去了")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" globalSay "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("sayThis"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("globalSay")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// window 浏览器中的 global 对象")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br")])]),a("p",[s._v("虽然箭头函数的 this 能够在编译的时候就确定了"),a("code",[s._v("this")]),s._v("的指向,但也需要注意一些潜在的坑")]),s._v(" "),a("p",[s._v("下面举个例子:")]),s._v(" "),a("p",[s._v("绑定事件监听")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" button "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" document"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("getElementById")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"mngb"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nbutton"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("addEventListener")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"click"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("===")]),s._v(" window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// true")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("innerHTML "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"clicked button"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br")])]),a("p",[s._v("上述可以看到,我们其实是想要"),a("code",[s._v("this")]),s._v("为点击的 button,但此时"),a("code",[s._v("this")]),s._v("指向了"),a("code",[s._v("window")])]),s._v(" "),a("p",[s._v("包括在原型上添加方法时候,此时"),a("code",[s._v("this")]),s._v("指向"),a("code",[s._v("window")])]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Cat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("sayName")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("===")]),s._v(" window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//true")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" cat "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Cat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"mm"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\ncat"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("sayName")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br")])]),a("p",[s._v("同样的,箭头函数不能作为构建函数")]),s._v(" "),a("h2",{attrs:{id:"四、优先级"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#四、优先级"}},[s._v("#")]),s._v(" 四、优先级")]),s._v(" "),a("hr"),s._v(" "),a("h3",{attrs:{id:"隐式绑定-vs-显式绑定"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#隐式绑定-vs-显式绑定"}},[s._v("#")]),s._v(" 隐式绑定 VS 显式绑定")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("a")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" foo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("a")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" foo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\nobj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 2")]),s._v("\nobj2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 3")]),s._v("\n\nobj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 3")]),s._v("\nobj2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 2")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br"),a("span",{staticClass:"line-number"},[s._v("17")]),a("br"),a("span",{staticClass:"line-number"},[s._v("18")]),a("br"),a("span",{staticClass:"line-number"},[s._v("19")]),a("br")])]),a("p",[s._v("显然,显示绑定的优先级更高")]),s._v(" "),a("h3",{attrs:{id:"new-绑定-vs-隐式绑定"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#new-绑定-vs-隐式绑定"}},[s._v("#")]),s._v(" new 绑定 VS 隐式绑定")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("something")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" something"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" foo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj2 "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\nobj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 2")]),s._v("\n\nobj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj2"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 3")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" bar "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("obj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 2")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("bar"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 4")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br"),a("span",{staticClass:"line-number"},[s._v("17")]),a("br"),a("span",{staticClass:"line-number"},[s._v("18")]),a("br"),a("span",{staticClass:"line-number"},[s._v("19")]),a("br")])]),a("p",[s._v("可以看到,new 绑定的优先级>隐式绑定")]),s._v(" "),a("p",[s._v("new 绑定 VS 显式绑定")]),s._v(" "),a("p",[s._v("因为"),a("code",[s._v("new")]),s._v("和"),a("code",[s._v("apply、call")]),s._v("无法一起使用,但硬绑定也是显式绑定的一种,可以替换测试")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("something")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" something"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" obj1 "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" bar "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("foo")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("bind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("bar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 2")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("var")]),s._v(" baz "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("bar")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 2")]),s._v("\nconsole"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("baz"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 3")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br")])]),a("p",[a("code",[s._v("bar")]),s._v("被绑定到"),a("code",[s._v("obj1")]),s._v("上,但是"),a("code",[s._v("new bar(3)")]),s._v("并没有像我们预计的那样把"),a("code",[s._v("obj1.a")]),s._v("修改为 3。但是,"),a("code",[s._v("new")]),s._v("修改了绑定调用"),a("code",[s._v("bar()")]),s._v("中的"),a("code",[s._v("this")])]),s._v(" "),a("p",[s._v("我们可认为"),a("code",[s._v("new绑定优先级")]),s._v(">"),a("code",[s._v("显式绑定")])]),s._v(" "),a("p",[s._v("综上,new 绑定优先级 > 显示绑定优先级 > 隐式绑定优先级 > 默认绑定优先级")]),s._v(" "),a("h2",{attrs:{id:"五、apply、call、bind-实现"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#五、apply、call、bind-实现"}},[s._v("#")]),s._v(" 五、apply、call、bind 实现")]),s._v(" "),a("ul",[a("li",[s._v("apply")])]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("myApply")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"function"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("throw")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Error")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"Type error"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n context "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" context "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 与上面代码相比,我们使用 Symbol 来保证属性唯一")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 也就是保证不会重写用户自己原来定义在 context 中的同名属性")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" fnSymbol "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("Symbol")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("fnSymbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 执行要被调用的方法")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("arguments"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("fnSymbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),s._v("arguments"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("else")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("fnSymbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("delete")]),s._v(" context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("fnSymbol"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br"),a("span",{staticClass:"line-number"},[s._v("17")]),a("br"),a("span",{staticClass:"line-number"},[s._v("18")]),a("br"),a("span",{staticClass:"line-number"},[s._v("19")]),a("br")])]),a("ul",[a("li",[s._v("call")])]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("myCall")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 判断调用对象")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"function"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("throw")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Error")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"Type error"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 首先获取参数")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" args "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),s._v("arguments"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("slice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 判断 context 是否传入,如果没有传就设置为 window")]),s._v("\n context "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" context "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 将被调用的方法设置为 context 的属性")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// this 即为我们要调用的方法")]),s._v("\n context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("fn "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 执行要被调用的方法")]),s._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),s._v("args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 删除手动增加的属性方法")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("delete")]),s._v(" context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("fn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 将执行结果返回")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br"),a("span",{staticClass:"line-number"},[s._v("17")]),a("br"),a("span",{staticClass:"line-number"},[s._v("18")]),a("br"),a("span",{staticClass:"line-number"},[s._v("19")]),a("br"),a("span",{staticClass:"line-number"},[s._v("20")]),a("br")])]),a("ul",[a("li",[s._v("bind")])]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("myBind")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 判断调用对象是否为函数")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"function"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("throw")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Error")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"Type error"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 获取参数")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" args "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),s._v("arguments"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("slice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" fn "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("Fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("apply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("instanceof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Fn")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("?")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("this")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 当前的这个 arguments 是指 Fn 的参数")]),s._v("\n args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("concat")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),s._v("arguments"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br")])]),a("h2",{attrs:{id:"_6、new-实现"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_6、new-实现"}},[s._v("#")]),s._v(" 6、new 实现")]),s._v(" "),a("ol",[a("li",[a("p",[s._v("首先创一个新的空对象。")])]),s._v(" "),a("li",[a("p",[s._v("根据原型链,设置空对象的 "),a("code",[s._v("__proto__")]),s._v(" 为构造函数的 "),a("code",[s._v("prototype")]),s._v(" 。")])]),s._v(" "),a("li",[a("p",[s._v("构造函数的 this 指向这个对象,执行构造函数的代码(为这个新对象添加属性)。")])]),s._v(" "),a("li",[a("p",[s._v("判断函数的返回值类型,如果是引用类型,就返回这个引用类型的对象。")])])]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("myNew")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("Fn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("...")]),s._v("args")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//1.创建一个空对象,并将对象的__proto__指向构造函数的prototype 这里我两步一起做了")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" Object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("create")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//2.将构造函数中的this指向obj,执行构造函数代码,获取返回值")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("Fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("apply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("res "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("instanceof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//3.判断返回值类型")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" res "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("instanceof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Object")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("?")]),s._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br")])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/25.8523deab.js b/assets/js/25.8523deab.js new file mode 100644 index 0000000..c93599e --- /dev/null +++ b/assets/js/25.8523deab.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{558:function(s,t,a){"use strict";a.r(t);var n=a(9),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"浅拷贝和深拷贝"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#浅拷贝和深拷贝"}},[s._v("#")]),s._v(" 浅拷贝和深拷贝")]),s._v(" "),a("p",[s._v("浅拷贝的实现:")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("shallowCopy")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 只拷贝对象")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!")]),s._v("object "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" object "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"object"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 根据 object 的类型判断是新建一个数组还是对象")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" newObject "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" Array"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("isArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("?")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 遍历 object,并且判断是 object 的属性才拷贝")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("for")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" key "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("in")]),s._v(" object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("hasOwnProperty")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n newObject"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" newObject"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br")])]),a("p",[s._v("深拷贝的实现:")]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("deepCopy")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!")]),s._v("object "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" object "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"object"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" newObject "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" Array"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("isArray")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("?")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("for")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" key "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("in")]),s._v(" object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("hasOwnProperty")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n newObject"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("===")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"object"')]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("?")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("deepCopy")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" object"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" newObject"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br")])]),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/**\n * 深拷贝\n * @param {Object} obj 要拷贝的对象\n * @param {Map} map 用于存储循环引用对象的地址\n */")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("deepClone")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" map "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Map")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" obj "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"object"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" result "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 初始化返回结果")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n obj "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("instanceof")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Array")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 加 || 的原因是为了防止 Array 的 prototype 被重写,Array.isArray 也是如此")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Object")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("prototype"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("===")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"[object Array]"')]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n result "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 防止循环引用")]),s._v("\n map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("for")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" key "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("in")]),s._v(" obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 保证 key 不是原型属性")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("hasOwnProperty")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 递归调用")]),s._v("\n result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("deepClone")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("obj"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" map"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 返回结果")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" result"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br"),a("span",{staticClass:"line-number"},[s._v("17")]),a("br"),a("span",{staticClass:"line-number"},[s._v("18")]),a("br"),a("span",{staticClass:"line-number"},[s._v("19")]),a("br"),a("span",{staticClass:"line-number"},[s._v("20")]),a("br"),a("span",{staticClass:"line-number"},[s._v("21")]),a("br"),a("span",{staticClass:"line-number"},[s._v("22")]),a("br"),a("span",{staticClass:"line-number"},[s._v("23")]),a("br"),a("span",{staticClass:"line-number"},[s._v("24")]),a("br"),a("span",{staticClass:"line-number"},[s._v("25")]),a("br"),a("span",{staticClass:"line-number"},[s._v("26")]),a("br"),a("span",{staticClass:"line-number"},[s._v("27")]),a("br"),a("span",{staticClass:"line-number"},[s._v("28")]),a("br"),a("span",{staticClass:"line-number"},[s._v("29")]),a("br"),a("span",{staticClass:"line-number"},[s._v("30")]),a("br"),a("span",{staticClass:"line-number"},[s._v("31")]),a("br"),a("span",{staticClass:"line-number"},[s._v("32")]),a("br"),a("span",{staticClass:"line-number"},[s._v("33")]),a("br"),a("span",{staticClass:"line-number"},[s._v("34")]),a("br"),a("span",{staticClass:"line-number"},[s._v("35")]),a("br"),a("span",{staticClass:"line-number"},[s._v("36")]),a("br")])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/26.9bb01893.js b/assets/js/26.9bb01893.js new file mode 100644 index 0000000..a059e54 --- /dev/null +++ b/assets/js/26.9bb01893.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{561:function(s,a,e){"use strict";e.r(a);var t=e(9),n=Object(t.a)({},(function(){var s=this,a=s.$createElement,e=s._self._c||a;return e("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[e("h2",{attrs:{id:"_1-连接到-linux-centos8-的服务器"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-连接到-linux-centos8-的服务器"}},[s._v("#")]),s._v(" 1.连接到 Linux CentOS8 的服务器")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[s._v("ssh")]),s._v(" -p "),e("span",{pre:!0,attrs:{class:"token number"}},[s._v("22")]),s._v(" root@ip\n//输入完之后会要输入密码,密码是不显示的,输入完回车就行\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br")])]),e("h2",{attrs:{id:"_2-安装编译器"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-安装编译器"}},[s._v("#")]),s._v(" 2.安装编译器")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[s._v("yum -y "),e("span",{pre:!0,attrs:{class:"token function"}},[s._v("install")]),s._v(" gcc pcre-devel zlib-devel openssl openssl-devel\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_3-建立存放的文件夹"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-建立存放的文件夹"}},[s._v("#")]),s._v(" 3.建立存放的文件夹")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[s._v("mkdir")]),s._v(" -p /www/nginx\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_4-移动到文件夹"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_4-移动到文件夹"}},[s._v("#")]),s._v(" 4.移动到文件夹")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[s._v("cd")]),s._v(" /www/nginx\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_5-下载-nginx"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_5-下载-nginx"}},[s._v("#")]),s._v(" 5.下载 nginx")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[s._v("wget")]),s._v(" http://nginx.org/download/nginx-1.20.2.tar.gz\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_6-解压-nginx-tar-gz"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_6-解压-nginx-tar-gz"}},[s._v("#")]),s._v(" 6.解压 nginx.tar.gz")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[s._v("tar")]),s._v(" -zxvf nginx-1.20.2.tar.gz\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_7-移动到解压的文件夹"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_7-移动到解压的文件夹"}},[s._v("#")]),s._v(" 7.移动到解压的文件夹")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[s._v("cd")]),s._v(" nginx-1.20.2\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_8-配置文件"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_8-配置文件"}},[s._v("#")]),s._v(" 8.配置文件")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[s._v("./configure --prefix"),e("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v("/usr/local/nginx --with-http_ssl_module --with-http_v2_module\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_9-编译和安装"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_9-编译和安装"}},[s._v("#")]),s._v(" 9.编译和安装")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[s._v("make")]),s._v("\n"),e("span",{pre:!0,attrs:{class:"token function"}},[s._v("make")]),s._v(" "),e("span",{pre:!0,attrs:{class:"token function"}},[s._v("install")]),s._v("\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br")])]),e("h2",{attrs:{id:"_10-查找安装路径和移动到文件夹"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_10-查找安装路径和移动到文件夹"}},[s._v("#")]),s._v(" 10.查找安装路径和移动到文件夹")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[e("span",{pre:!0,attrs:{class:"token function"}},[s._v("whereis")]),s._v(" nginx\n"),e("span",{pre:!0,attrs:{class:"token builtin class-name"}},[s._v("cd")]),s._v(" /usr/local/nginx\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br"),e("span",{staticClass:"line-number"},[s._v("2")]),e("br")])]),e("h2",{attrs:{id:"_11-启动-nginx"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_11-启动-nginx"}},[s._v("#")]),s._v(" 11.启动 nginx")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[s._v("./sbin/nginx\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])]),e("h2",{attrs:{id:"_12-重新加载配置"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_12-重新加载配置"}},[s._v("#")]),s._v(" 12.重新加载配置")]),s._v(" "),e("hr"),s._v(" "),e("div",{staticClass:"language-shell line-numbers-mode"},[e("pre",{pre:!0,attrs:{class:"language-shell"}},[e("code",[s._v("./sbin/nginx -s reload\n")])]),s._v(" "),e("div",{staticClass:"line-numbers-wrapper"},[e("span",{staticClass:"line-number"},[s._v("1")]),e("br")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/27.26743516.js b/assets/js/27.26743516.js new file mode 100644 index 0000000..4d7c3c2 --- /dev/null +++ b/assets/js/27.26743516.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{562:function(s,a,t){"use strict";t.r(a);var e=t(9),r=Object(e.a)({},(function(){var s=this,a=s.$createElement,t=s._self._c||a;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("h2",{attrs:{id:"项目初始化"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#项目初始化"}},[s._v("#")]),s._v(" 项目初始化")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git init\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br")])]),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"title"}),t("p",[s._v("项目初始化之后会生成一个.git 文件,如果看不见,那就是电脑隐藏了以.开头的文件")])]),t("h2",{attrs:{id:"项目关联"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#项目关联"}},[s._v("#")]),s._v(" 项目关联")]),s._v(" "),t("hr"),s._v(" "),t("h3",{attrs:{id:"克隆项目"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#克隆项目"}},[s._v("#")]),s._v(" 克隆项目")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git clone <项目地址>\ngit clone -branch [tags标签] <项目地址>\t或\tgit clone -b [tags标签] [项目地址]\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br")])]),t("p",[s._v("表示从远程仓库拉取项目到本地")]),s._v(" "),t("h3",{attrs:{id:"本地项目关联远程仓库"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#本地项目关联远程仓库"}},[s._v("#")]),s._v(" 本地项目关联远程仓库")]),s._v(" "),t("hr"),s._v(" "),t("p",[s._v("如果我们本地是有项目的,我们想要的是将本地项目和远程仓库关联起来,那么有如下两种情况")]),s._v(" "),t("ul",[t("li",[s._v("本地已有文件与 Git 仓库关联起来(空仓库)")])]),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("div",{staticClass:"highlight-lines"},[t("br"),t("br"),t("br"),t("br"),t("div",{staticClass:"highlighted"},[s._v(" ")]),t("br")]),t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v('git init\ngit remote add origin <项目地址>\ngit add .\t//记得点(.)是要空格隔开\ngit commit -m "<提交的信息记录>"\ngit push --set-upstream origin master 或 git push -u origin master\n')])]),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br")])]),t("ul",[t("li",[s._v("非空仓库的情况:")])]),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("div",{staticClass:"highlight-lines"},[t("br"),t("br"),t("br"),t("br"),t("div",{staticClass:"highlighted"},[s._v(" ")]),t("br"),t("div",{staticClass:"highlighted"},[s._v(" ")]),t("br")]),t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git init\ngit remote add origin xxxx\ngit add .\ngit commit -m 'init'\ngit pull origin master --allow-unrelated-histories\n//若有冲突,先解决冲突\ngit push --set-upstream origin master\n")])]),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br")])]),t("p",[s._v("可以看出来这两种情况只有在第 5 步的时候才是有区别的.")]),s._v(" "),t("div",{staticClass:"custom-block danger"},[t("p",{staticClass:"title"},[s._v("在上面的 commit 到本地仓库后,如果直接推送,它会报错:")]),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("refusing to merge unrelated histories\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br")])]),t("p",[s._v("意思就是拒绝合并没有历史关系的分支,我们用下面的代码解决这个问题")])]),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"title"},[s._v("然后添加下面这行代码:")]),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git pull origin master --allow-unrelated-histories\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br")])]),t("p",[s._v("我们允许拉取没有历史关系的分支,这步也就是我们代码的第 5 步")])]),t("h2",{attrs:{id:"分支操作"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#分支操作"}},[s._v("#")]),s._v(" 分支操作")]),s._v(" "),t("hr"),s._v(" "),t("h3",{attrs:{id:"查看分支"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#查看分支"}},[s._v("#")]),s._v(" 查看分支")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git branch //查看本地分支\ngit branch -r //查看远程分支\ngit branch -a //查看本地+远程分支\ngit branch -v //分支最后一次提交的信息\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br")])]),t("h3",{attrs:{id:"切换分支"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#切换分支"}},[s._v("#")]),s._v(" 切换分支")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git branch //创建新分支\ngit checkout //切换分支\ngit checkout -b //创建新分支并切换到分支\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br")])]),t("h3",{attrs:{id:"拉去分支"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#拉去分支"}},[s._v("#")]),s._v(" 拉去分支")]),s._v(" "),t("hr"),s._v(" "),t("p",[s._v("将远程 Git 仓库里的指定分支拉取到本地(本地不存在的分支)")]),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git checkout -b <本地分支名> \n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br")])]),t("h3",{attrs:{id:"删除分支"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#删除分支"}},[s._v("#")]),s._v(" 删除分支")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git branch -d //删除本地分支\ngit push origin : //删除远程分支\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br")])]),t("h3",{attrs:{id:"创建本地新分支并推送到远程"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#创建本地新分支并推送到远程"}},[s._v("#")]),s._v(" 创建本地新分支并推送到远程")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git branch -b //创建本地新分支并切换到新分支\ngit push --set-upstream origin \n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br")])]),t("h3",{attrs:{id:"暂存"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#暂存"}},[s._v("#")]),s._v(" 暂存")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"title"},[s._v("不想提交当前代码到远程仓库")]),t("p",[s._v("有时候,我们想要切换分支,但是又不想将当前分支代码提交到本地或远程仓库,直接切换过去的话代码会被覆盖,这时候我们可以使用暂存功能")])]),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git stash //存\ngit stash pop //取出暂存\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br")])]),t("h2",{attrs:{id:"提交操作"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#提交操作"}},[s._v("#")]),s._v(" 提交操作")]),s._v(" "),t("hr"),s._v(" "),t("h3",{attrs:{id:"代码提交"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#代码提交"}},[s._v("#")]),s._v(" 代码提交")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v('git add .\ngit commit -m "<提交的信息记录>"\ngit push\n')])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br")])]),t("p",[s._v("提交的时候,可以输入 emoji 表情,可爱又有趣,别人一眼看过来就知道你提交的是关于什么")]),s._v(" "),t("p",[s._v("🐛 //修复 BUG 💄 //更新样式 🔒 //解决安全问题 ♻️ //重构 ✨ //添加新功能")]),s._v(" "),t("h3",{attrs:{id:"提交历史"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#提交历史"}},[s._v("#")]),s._v(" 提交历史")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git log\ngit log -3 //显示最近3次的更新\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br")])]),t("h3",{attrs:{id:"本地代码回滚"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#本地代码回滚"}},[s._v("#")]),s._v(" 本地代码回滚")]),s._v(" "),t("hr"),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git reset --hard commit-id //回滚到commit-id\ngit reset --hard HEAD~3 //将最近三次的提交回滚\ngit reset --hard HEAD^ //将本地代码回退到上一个版本\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br")])]),t("h3",{attrs:{id:"标签功能"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#标签功能"}},[s._v("#")]),s._v(" 标签功能")]),s._v(" "),t("hr"),s._v(" "),t("p",[s._v("有时候,我们的项目上线了,我们就需要标签功能,记录我们的版本")]),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git tag //显示已有的标签\ngit tag //创建一个轻量级标签\ngit tag -a -m ‘’ //创建一个带有标注的标签\ngit tag -d //删除标签\ngit push //并不会把tag标签传送到远端服务器上,只有通过显式命令才能分享标签到远端仓库\ngit push origin //push单个tag\ngit push origin --tags //推送所有本地新增的标签\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br")])]),t("h2",{attrs:{id:"配置"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#配置"}},[s._v("#")]),s._v(" 配置")]),s._v(" "),t("hr"),s._v(" "),t("h3",{attrs:{id:"config-配置"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#config-配置"}},[s._v("#")]),s._v(" config 配置")]),s._v(" "),t("hr"),s._v(" "),t("p",[s._v("最后我们来说一下 config 配置")]),s._v(" "),t("div",{staticClass:"language- line-numbers-mode"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[s._v("git config --global user.name //查看全局配置的用户名\ngit config --global user.email //查看全局配置的邮箱\ngit config --global user.name 'zhangsha' //配置全局的用户名\ngit config --global user.email 'xx@xx.com' //配置全局的邮箱\n//下面是针对单独的项目进行配置和查看\ngit config user.name 'lisi' //配置当前项目的用户名\ngit config user.name //查看当前项目的用户名\ngit config --list //查看多个配置\n")])]),s._v(" "),t("div",{staticClass:"line-numbers-wrapper"},[t("span",{staticClass:"line-number"},[s._v("1")]),t("br"),t("span",{staticClass:"line-number"},[s._v("2")]),t("br"),t("span",{staticClass:"line-number"},[s._v("3")]),t("br"),t("span",{staticClass:"line-number"},[s._v("4")]),t("br"),t("span",{staticClass:"line-number"},[s._v("5")]),t("br"),t("span",{staticClass:"line-number"},[s._v("6")]),t("br"),t("span",{staticClass:"line-number"},[s._v("7")]),t("br"),t("span",{staticClass:"line-number"},[s._v("8")]),t("br")])]),t("blockquote",[t("p",[s._v("配置分为全局配置和项目配置,没有对项目进行单独配置的时候,会默认使用全局的配置.如果我们在一个项目中进行了单独的配置,那么就会使用项目中配置.这个选项在你切换不同项目(比如公司和个人项目)的时候,可以起到一定的作用.")])])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/28.1951fccb.js b/assets/js/28.1951fccb.js new file mode 100644 index 0000000..b7db20c --- /dev/null +++ b/assets/js/28.1951fccb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{565:function(t,e,n){"use strict";n.r(e);var s=n(9),l=Object(s.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);e.default=l.exports}}]); \ No newline at end of file diff --git a/assets/js/29.5335ba69.js b/assets/js/29.5335ba69.js new file mode 100644 index 0000000..9cb281d --- /dev/null +++ b/assets/js/29.5335ba69.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{566:function(t,a,s){"use strict";s.r(a);var n=s(9),e=Object(n.a)({},(function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h2",{attrs:{id:"_1-title标签"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-title标签"}},[t._v("#")]),t._v(" 1.Title标签")]),t._v(" "),s("hr"),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("title")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("页面标签"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[s("code",[t._v("")]),t._v("标签可以说是最主要、最重要的SEOn优化的元素。它将直接显示在搜索引擎的接口页里面,社交媒体分享,浏览器的标签页都将直接使用这个标题。")]),t._v(" "),s("p",[t._v("标题对于让用户快速了解搜索结果的内容至关重要。这是用户对你网页的第一印象,它通常是决定点击哪个结果的重要影响因素,因此在你的网页上使用高质量的标题很重要。")]),t._v(" "),s("p",[t._v("最佳实践:")]),t._v(" "),s("ul",[s("li",[t._v("为每个页面写一个唯一的标题标签")]),t._v(" "),s("li",[t._v("简短但具有描述性")]),t._v(" "),s("li",[t._v("避免通用和模糊的标题")]),t._v(" "),s("li",[t._v("创造一些值得点击的东西,抓住用户的好奇心")]),t._v(" "),s("li",[t._v("去猜测搜索意图,尽量匹配上")]),t._v(" "),s("li",[t._v("包含长尾关键字")]),t._v(" "),s("li",[t._v("保持在60个字符以内,超过这个长度搜索引擎会将标题截断")])]),t._v(" "),s("h2",{attrs:{id:"_2-meta-description标签"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-meta-description标签"}},[t._v("#")]),t._v(" 2.Meta Description标签")]),t._v(" "),s("hr"),t._v(" "),s("p",[t._v("该meta标签用于描述总结页面的内容。搜索引擎经常将其用于搜索结果的片段中,放在标题下面。它占据了搜索结果片段的很大部分的内容,内容的好坏很大程度上会影响用户是否点击这个结果,你需要设置一个引人注目的描述。谷歌不使用描述作为排名英语。")]),t._v(" "),s("p",[t._v("最佳实践:")]),t._v(" "),s("ul",[s("li",[t._v("给每个页面一个独特的描述,并清楚的反映内容")]),t._v(" "),s("li",[t._v("描述必须即真实又吸引人")]),t._v(" "),s("li",[t._v("Google的摘要通常最多可包含150-160个字符(包括空格)")]),t._v(" "),s("li",[t._v("包括你最重要的关键字,以便它们可以在搜索结果页上突出显示,但要小心避免关键字堆砌")])]),t._v(" "),s("h2",{attrs:{id:"_3-标题标签-h1-h6"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-标题标签-h1-h6"}},[t._v("#")]),t._v(" 3.标题标签(h1-h6)")]),t._v(" "),s("hr"),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("h1"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("h2"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("h3"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("h4"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("h5"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("h6"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("h1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br")])]),s("p",[t._v("标题标签是HTML标签,HTML"),s("code",[t._v("<h1>-<h6>")]),t._v("标题(Heading)元素呈现了六个不同的级别的标题,"),s("code",[t._v("<h1>")]),t._v(" 级别最高,而"),s("code",[t._v("<h6>")]),t._v("级别最低。它可以用来识别内容的结果层级。")]),t._v(" "),s("p",[t._v("现在标题标签不再是搜索引擎排名因素,标题标签中添加关键字,不一定可以使你的排名更好,但是对爬虫来说理解组织良好的内容更为容易。同时也方便用户理解页面内容。")]),t._v(" "),s("p",[t._v("最佳实践:")]),t._v(" "),s("ul",[s("li",[t._v("给每个页面一个独特的描述,并清楚地放映内容")]),t._v(" "),s("li",[t._v("描述必须即真实又吸引人")]),t._v(" "),s("li",[t._v("Google 的摘要通常最多可包含 150-160 个字符(包括空格)")]),t._v(" "),s("li",[t._v("包括你最重要的关键字,以便它们可以在搜索结果页上上突出显示,但要小心避免关键字堆砌")])]),t._v(" "),s("h2",{attrs:{id:"_4-图片alt属性"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-图片alt属性"}},[t._v("#")]),t._v(" 4.图片Alt属性")]),t._v(" "),s("hr"),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("img")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("src")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("https://popeke.com/images/popeke@750w_20h.png"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("alt")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("popeke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("图片的alt属性被添加到"),s("code",[t._v("<img/>")]),t._v("标签以描述其内容。")]),t._v(" "),s("p",[t._v("Alt属性在页面优化方面很重要,原因有两个:")]),t._v(" "),s("ul",[s("li",[t._v("如果无法加载任何特定图像(或图像被禁用),则会访问者显示替代文本。")]),t._v(" "),s("li",[t._v("搜索引擎无法读取图像,你应该为图像添加适当的替代文字,以便搜索引擎知道如何解释它们")])]),t._v(" "),s("p",[t._v("最佳实践:")]),t._v(" "),s("ul",[s("li",[t._v("始终使用正确的描述,切勿在此标签中填充关键字")]),t._v(" "),s("li",[t._v("使用信息丰富的文件名,且清楚明了")]),t._v(" "),s("li",[t._v("创建图像站点地图")]),t._v(" "),s("li",[t._v("在替代文本中使用 50-55 个字符(最多16个单词)")])]),t._v(" "),s("h2",{attrs:{id:"_5-robots-meta标签"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-robots-meta标签"}},[t._v("#")]),t._v(" 5.Robots Meta标签")]),t._v(" "),s("hr"),t._v(" "),s("p",[t._v("机器人元标记告诉搜索引擎索引或不索引你的网页。")]),t._v(" "),s("p",[t._v("该标签对搜索引擎爬虫有四个主要值:")]),t._v(" "),s("ul",[s("li",[t._v("follow - 搜索引擎爬虫将跟随该网页中的所有链接")]),t._v(" "),s("li",[t._v("index – 搜索引擎爬虫会索引整个网页")]),t._v(" "),s("li",[t._v("nofollow – 搜索引擎爬虫不会跟踪页面和该网页中的任何链接")]),t._v(" "),s("li",[t._v("noindex – 搜索引擎爬虫不会将该网页编入索引 为你的机器人元标记使用以下语法:")])]),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("robots"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("noindex, nofollow"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" 表示不索引或不关注本网页。\n\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("robots"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("index, follow"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" 表示索引并关注这个网页。\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br")])]),s("p",[t._v("最佳实践:")]),t._v(" "),s("ul",[s("li",[t._v("仅当你想限制搜索引擎抓取页面时才使用 Robots meta 标签")]),t._v(" "),s("li",[t._v("不要在 robots.txt 中屏蔽带 Robots meta 标签的页面")])]),t._v(" "),s("h2",{attrs:{id:"_6-canonical标签"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-canonical标签"}},[t._v("#")]),t._v(" 6.Canonical标签")]),t._v(" "),s("hr"),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("link")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("rel")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("canonical"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("href")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("https://popeke.com/"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("rel=“canonical” link 标签为类似网页或重复网页指定权威网页。 它告诉搜索引擎哪个版本的页面是主要页面并希望被搜索引擎索引。")]),t._v(" "),s("h2",{attrs:{id:"_7-社交媒体-meta-标签"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-社交媒体-meta-标签"}},[t._v("#")]),t._v(" 7.社交媒体 Meta 标签")]),t._v(" "),s("hr"),t._v(" "),s("p",[t._v("现如今有两个主要标准定义如何格式化此元数据:Twitter Cards 和 Facebook Open Graph 协议。")]),t._v(" "),s("h3",{attrs:{id:"一、facebook-open-graph"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一、facebook-open-graph"}},[t._v("#")]),t._v(" 一、Facebook Open Graph")]),t._v(" "),s("hr"),t._v(" "),s("p",[t._v("Open Graph (开放图谱协议)由 Facebook 的创建,简称 OG 协议或 OGP。它是 Facebook 在 2010 年 F8 开发者大会公布的一种网页元信息(Meta Information)标记协议,属于 Meta Tag (Meta 标签)的范畴,是一种为社交分享而生的 Meta 标签。它允许在 Facebook 上,其他网站能像 Facebook 内容一样具有丰富的媒体对象,进而促进 Facebook 和其他网站之间的集成。")]),t._v(" "),s("p",[t._v("Open Graph 标签不仅被 Facebook 使用,也被 LinkedIn 和 Twitter 等平台使用。请注意 Twitter 也有自己的一套 Twitter Cards 定义,如果网页提供了 Twitter 自己的定义,则优先使用自己的标准。")]),t._v(" "),s("h4",{attrs:{id:"open-graph-常用属性"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#open-graph-常用属性"}},[t._v("#")]),t._v(" Open Graph 常用属性")]),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[t._v("# 标题\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("HTML meta 标签详解"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n# 类型\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:type"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("article"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n# 网页的永久链接\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("https://popeke.com/"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n# 网页的需要展示图片\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:image"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("https://popeke.com/images/popeke@750w_20h.png"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br"),s("span",{staticClass:"line-number"},[t._v("7")]),s("br"),s("span",{staticClass:"line-number"},[t._v("8")]),s("br")])]),s("p",[t._v("对于 Open Graph 来说,每个页面里需要以上四个必需属性:")]),t._v(" "),s("ul",[s("li",[t._v("og:title - 网页的标题,例如“刘星的个人网站”")]),t._v(" "),s("li",[t._v("og:type - 网页的类型,所描述内容的类型。可以是 article,book,website, profile 等")]),t._v(" "),s("li",[t._v("og:image - 一个图像 URL, 用于设置与页面关联的图像")]),t._v(" "),s("li",[t._v("og:url - 对象的规范 URL")])]),t._v(" "),s("p",[t._v("Open Graph 协议定义了一些网页类型, 包括 article、book、website、profile 等。")]),t._v(" "),s("p",[t._v("如果你的网页为个人主页,"),s("code",[t._v("og:type")]),t._v(" 可以为 "),s("code",[t._v("profile")]),t._v(";如果你的网页是一个视频为主的网页面,则可以为"),s("code",[t._v("video")]),t._v(";如果你的网页是一篇博客文章则可以为"),s("code",[t._v("article")]),t._v("。如果你的网页没什么特殊的类别,则可将"),s("code",[t._v("og:type")]),t._v(" 设置为通用的"),s("code",[t._v("website")]),t._v("。")]),t._v(" "),s("p",[t._v("除了以上四个必需属性之外,Open Graph 还有以下常用属性:")]),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:description"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Description Here"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:site_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("Site Name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:locale"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("zh_CN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:video"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("link"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("property")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("og:audio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("link"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br")])]),s("ul",[s("li",[t._v("og:site_name 你的网站的名称")]),t._v(" "),s("li",[t._v("og:description 你的页面的描述")]),t._v(" "),s("li",[t._v("og:audio - 网页中的音频链接")]),t._v(" "),s("li",[t._v("og:locale - 标记语言环境。格式为 language_TERRITORY。默认为 en_US。")]),t._v(" "),s("li",[t._v("og:video - 你网页中的视频链接")])]),t._v(" "),s("p",[t._v("除了以上介绍的常用内容外,Open Graph 还有很多属性。有关 Open Graph 协议的更多信息,请访问官方 Open Graph 协议网站 "),s("a",{attrs:{href:"https://ogp.me/",target:"_blank",rel:"noopener noreferrer"}},[t._v("https://ogp.me/"),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("如果你的网站设置了 Open Graph 你可以使用 "),s("a",{attrs:{href:"https://developers.facebook.com/tools/debug/",target:"_blank",rel:"noopener noreferrer"}},[t._v("facebook 的 debug 工具"),s("OutboundLink")],1),t._v(" 来调试及查看显示效果")]),t._v(" "),s("h3",{attrs:{id:"二、twitter-card"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#二、twitter-card"}},[t._v("#")]),t._v(" 二、Twitter Card")]),t._v(" "),s("hr"),t._v(" "),s("p",[t._v("大多数社交网站都遵循 Open Graph 协议,但是也有一些平台自己实现了一些定义,例如 Twitter。")]),t._v(" "),s("p",[t._v("Twitter Cards 是 Twitter 使用的元数据规范,用于在 Twitter 上共享链接时显示富文本、图像和视频。")]),t._v(" "),s("h4",{attrs:{id:"twitter-cards-常用属性"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#twitter-cards-常用属性"}},[t._v("#")]),t._v(" Twitter Cards 常用属性")]),t._v(" "),s("p",[t._v("Twitter Cards 有四种不同的类型:Summary, Summary Card With Large Image, App, 和 Player.")]),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),t._v("twitter:card")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("summary_large_image"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),t._v("twitter:image")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("https://popeke.com/images/popeke@750w_20h.png"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),t._v("twitter:title")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("HTML meta 标签详解"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),t._v("twitter:description")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("meta 标签标签定义了关于 HTML 文档的元数据"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("twitter:creator"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("@yedaniu"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("twitter:site"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("@site_account"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br"),s("span",{staticClass:"line-number"},[t._v("2")]),s("br"),s("span",{staticClass:"line-number"},[t._v("3")]),s("br"),s("span",{staticClass:"line-number"},[t._v("4")]),s("br"),s("span",{staticClass:"line-number"},[t._v("5")]),s("br"),s("span",{staticClass:"line-number"},[t._v("6")]),s("br")])]),s("ul",[s("li",[t._v("twitter:card : 卡片类型,将是 summary、summary_large_image、app 或 player 之一")]),t._v(" "),s("li",[t._v("twitter:site : 用于卡片页脚中使用的网站 @username")]),t._v(" "),s("li",[t._v("twitter:creator :内容创建者 / 作者的 @username")]),t._v(" "),s("li",[t._v("twitter:url : 分享对象的链接")]),t._v(" "),s("li",[t._v("twitter:title : 分享对象的标题 (最多 70 个字符)")]),t._v(" "),s("li",[t._v("twitter:description : 分享对象的描述 (最多 200 个字符)")]),t._v(" "),s("li",[t._v("twitter:image : 分享对象的图片 URL, 支持的格式有 JPG、PNG、WEBP 和 GIF。只会导入 GIF 的第一帧")])]),t._v(" "),s("p",[t._v("上面介绍了 Twitter Cards 一些常用属性,有关其他 Twitter Card 标签和选项的更多信息,请访问『官方 Twitter Cards 文档』"),s("a",{attrs:{href:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",target:"_blank",rel:"noopener noreferrer"}},[t._v("( https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards)"),s("OutboundLink")],1),t._v("。")]),t._v(" "),s("p",[t._v("如果你的网站设置了 Open Graph 你可以使用 "),s("a",{attrs:{href:"https://cards-dev.twitter.com/validator",target:"_blank",rel:"noopener noreferrer"}},[t._v("Twitter Cards"),s("OutboundLink")],1),t._v(" 验证器 来调试及查看显示效果")]),t._v(" "),s("h4",{attrs:{id:"open-graph-与-twitter-cards-常用属性汇总"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#open-graph-与-twitter-cards-常用属性汇总"}},[t._v("#")]),t._v(" Open Graph 与 Twitter Cards 常用属性汇总")]),t._v(" "),s("p",[t._v("Facebook 和 Twitter 提供了有关如何使用上述元标记的指南。在下表中,我们总结了有关它们的基本信息以及各自的建议。")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",{staticStyle:{"text-align":"center"}},[t._v("元标签")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("facebook")]),t._v(" "),s("th",{staticStyle:{"text-align":"center"}},[t._v("twitter")])])]),t._v(" "),s("tbody",[s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("标题")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("og:title 文章的标题,例如你的网站名称。")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("twitter:title Twitter 卡片的必需参数,最大长度 70 个字符。")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("图片")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("og:image 当有人将内容分享到 Facebook 时显示的图像的 URL")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("twitter:image 表示页面内容的唯一图像的 URL")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("网站")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("og:url 你页面的规范 URL")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("twitter:url 你页面的规范 URL")])]),t._v(" "),s("tr",[s("td",{staticStyle:{"text-align":"center"}},[t._v("描述")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("og:description 对内容的简要描述,通常在 2 到 4 个句子之间。这将显示在 Facebook 帖子的标题下方")]),t._v(" "),s("td",{staticStyle:{"text-align":"center"}},[t._v("Twitter:description 简明概括内容的描述,适合在推文中呈现。你不应重复使用标题作为描述或使用此字段来描述网站提供的一般服务")])])])]),t._v(" "),s("h2",{attrs:{id:"_8-响应式设计-viewport-meta-标签"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_8-响应式设计-viewport-meta-标签"}},[t._v("#")]),t._v(" 8. 响应式设计 viewport Meta 标签")]),t._v(" "),s("hr"),t._v(" "),s("p",[t._v("视口标记允许你配置页面在任何设备上的缩放和显示方式。")]),t._v(" "),s("div",{staticClass:"language-HTML line-numbers-mode"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("viewport"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("width=device-width, initial-scale=1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n")])]),t._v(" "),s("div",{staticClass:"line-numbers-wrapper"},[s("span",{staticClass:"line-number"},[t._v("1")]),s("br")])]),s("p",[t._v("视口元标记与排名没有直接关系,但与用户体验有关。")]),t._v(" "),s("p",[t._v("同时谷歌在移动搜索结果中对移动端友好的网页的排名更高")]),t._v(" "),s("p",[t._v("最佳实践:")]),t._v(" "),s("ul",[s("li",[t._v("在所有网页上设置 viewport 标签")])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/3.f7e531a1.js b/assets/js/3.f7e531a1.js new file mode 100644 index 0000000..1145d5f --- /dev/null +++ b/assets/js/3.f7e531a1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{426:function(t,e,a){},427:function(t,e,a){},428:function(t,e,a){},431:function(t,e,a){},432:function(t,e,a){"use strict";a(68);var n=a(130),r=a(424),o=a(423),s=Object(n.b)({components:{RecoIcon:r.b},props:{pageInfo:{type:Object,default:function(){return{}}},currentTag:{type:String,default:""},showAccessNumber:{type:Boolean,default:!1}},setup:function(t,e){var a=Object(o.a)();return{numStyle:{fontSize:".9rem",fontWeight:"normal",color:"#999"},goTags:function(t){a.$route.path!=="/tag/".concat(t,"/")&&a.$router.push({path:"/tag/".concat(t,"/")})},formatDateValue:function(t){return new Intl.DateTimeFormat(a.$lang).format(new Date(t))}}}}),i=(a(433),a(9)),c=Object(i.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.pageInfo.frontmatter.author||t.$themeConfig.author?a("reco-icon",{attrs:{icon:"reco-account"}},[a("span",[t._v(t._s(t.pageInfo.frontmatter.author||t.$themeConfig.author))])]):t._e(),t._v(" "),t.pageInfo.frontmatter.date?a("reco-icon",{attrs:{icon:"reco-date"}},[a("span",[t._v(t._s(t.formatDateValue(t.pageInfo.frontmatter.date)))])]):t._e(),t._v(" "),!0===t.showAccessNumber?a("reco-icon",{attrs:{icon:"reco-eye"}},[a("AccessNumber",{attrs:{idVal:t.pageInfo.path,numStyle:t.numStyle}})],1):t._e(),t._v(" "),t.pageInfo.frontmatter.tags?a("reco-icon",{staticClass:"tags",attrs:{icon:"reco-tag"}},t._l(t.pageInfo.frontmatter.tags,(function(e,n){return a("span",{key:n,staticClass:"tag-item",class:{active:t.currentTag==e},on:{click:function(a){return a.stopPropagation(),t.goTags(e)}}},[t._v(t._s(e))])})),0):t._e()],1)}),[],!1,null,"f875f3fc",null);e.a=c.exports},433:function(t,e,a){"use strict";a(426)},434:function(t,e,a){"use strict";a(427)},435:function(t,e,a){"use strict";a(428)},436:function(t,e,a){"use strict";a(32);var n=a(130),r=(a(226),{methods:{_getStoragePage:function(){var t=window.location.pathname,e=JSON.parse(sessionStorage.getItem("currentPage"));return null===e||t!==e.path?(sessionStorage.setItem("currentPage",JSON.stringify({page:1,path:""})),1):parseInt(e.page)},_setStoragePage:function(t){var e=window.location.pathname;sessionStorage.setItem("currentPage",JSON.stringify({page:t,path:e}))}}}),o=a(424),s=a(432),i=Object(n.b)({components:{PageInfo:s.a,RecoIcon:o.b},props:["item","currentPage","currentTag"]}),c=(a(434),a(9)),l=Object(c.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-item",on:{click:function(e){return t.$router.push(t.item.path)}}},[t.item.frontmatter.sticky?a("reco-icon",{attrs:{icon:"reco-sticky"}}):t._e(),t._v(" "),a("div",{staticClass:"title"},[t.item.frontmatter.keys?a("reco-icon",{attrs:{icon:"reco-lock"}}):t._e(),t._v(" "),a("router-link",{attrs:{to:t.item.path}},[t._v(t._s(t.item.title))])],1),t._v(" "),a("div",{staticClass:"abstract",domProps:{innerHTML:t._s(t.item.excerpt)}}),t._v(" "),a("PageInfo",{attrs:{pageInfo:t.item,currentTag:t.currentTag}})],1)}),[],!1,null,"ff2c8be0",null).exports,u=a(423),p=Object(n.b)({mixins:[r],components:{NoteAbstractItem:l},props:["data","currentTag"],setup:function(t,e){var a=Object(u.a)(),r=Object(n.h)(t).data,o=Object(n.g)(1),s=Object(n.a)((function(){var t=(o.value-1)*a.$perPage,e=o.value*a.$perPage;return r.value.slice(t,e)}));return Object(n.d)((function(){o.value=a._getStoragePage()||1})),{currentPage:o,currentPageData:s,getCurrentPage:function(t){o.value=t,a._setStoragePage(t),e.emit("paginationChange",t)}}},watch:{$route:function(){this.currentPage=this._getStoragePage()||1}}}),f=(a(435),Object(c.a)(p,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-wrapper"},[t._l(t.currentPageData,(function(e){return a("NoteAbstractItem",{key:e.path,attrs:{item:e,currentPage:t.currentPage,currentTag:t.currentTag}})})),t._v(" "),a("pagation",{staticClass:"pagation",attrs:{total:t.data.length,currentPage:t.currentPage},on:{getCurrentPage:t.getCurrentPage}})],2)}),[],!1,null,"6cc0658a",null));e.a=f.exports},439:function(t,e,a){"use strict";a(431)},441:function(t,e,a){"use strict";var n=a(50),r=(a(131),a(130)),o=a(93),s=a(423),i=Object(r.b)({props:{currentTag:{type:String,default:""}},setup:function(t,e){var a=Object(s.a)();return{tags:Object(r.a)((function(){return[{name:a.$recoLocales.all,path:"/tag/"}].concat(Object(n.a)(a.$tagesList))})),tagClick:function(t){e.emit("getCurrentTag",t)},getOneColor:o.b}}}),c=(a(439),a(9)),l=Object(c.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tags"},t._l(t.tags,(function(e,n){return a("span",{directives:[{name:"show",rawName:"v-show",value:!e.pages||e.pages&&e.pages.length>0,expression:"!item.pages || (item.pages && item.pages.length > 0)"}],key:n,class:{active:e.name==t.currentTag},style:{backgroundColor:t.getOneColor()},on:{click:function(a){return t.tagClick(e)}}},[t._v(t._s(e.name))])})),0)}),[],!1,null,"285c9a44",null);e.a=l.exports},463:function(t,e,a){},464:function(t,e,a){},465:function(t,e,a){},466:function(t,e,a){},467:function(t,e,a){},468:function(t,e,a){},469:function(t,e,a){},470:function(t,e,a){},505:function(t,e,a){"use strict";a(463)},506:function(t,e,a){"use strict";a(464)},507:function(t,e,a){t.exports=a.p+"assets/img/bg.2cfdbb33.svg"},508:function(t,e,a){"use strict";a(465)},509:function(t,e,a){"use strict";a(466)},510:function(t,e,a){"use strict";a(467)},511:function(t){t.exports=JSON.parse('{"a":"1.6.11"}')},512:function(t,e,a){"use strict";a(468)},513:function(t,e,a){"use strict";a(469)},514:function(t,e,a){"use strict";a(470)},546:function(t,e,a){"use strict";a.r(e);var n=a(130),r=a(443),o=a(424),s=a(423),i=Object(n.b)({components:{NavLink:r.a,ModuleTransition:o.a},setup:function(t,e){var a=Object(s.a)();return{recoShowModule:Object(n.a)((function(){return a&&a.$parent.recoShowModule})),actionLink:Object(n.a)((function(){return a&&{link:a.$frontmatter.actionLink,text:a.$frontmatter.actionText}})),heroImageStyle:Object(n.a)((function(){return a.$frontmatter.heroImageStyle||{maxHeight:"200px",margin:"6rem auto 1.5rem"}}))}}}),c=(a(505),a(9)),l=Object(c.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"home"},[a("div",{staticClass:"hero"},[a("ModuleTransition",[t.recoShowModule&&t.$frontmatter.heroImage?a("img",{style:t.heroImageStyle||{},attrs:{src:t.$withBase(t.$frontmatter.heroImage),alt:"hero"}}):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.04"}},[t.recoShowModule&&null!==t.$frontmatter.heroText?a("h1",{style:{marginTop:t.$frontmatter.heroImage?"0px":"140px"}},[t._v("\n "+t._s(t.$frontmatter.heroText||t.$title||"vuePress-theme-reco")+"\n ")]):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.08"}},[t.recoShowModule&&null!==t.$frontmatter.tagline?a("p",{staticClass:"description"},[t._v("\n "+t._s(t.$frontmatter.tagline||t.$description||"Welcome to your vuePress-theme-reco site")+"\n ")]):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.16"}},[t.recoShowModule&&t.$frontmatter.actionText&&t.$frontmatter.actionLink?a("p",{staticClass:"action"},[a("NavLink",{staticClass:"action-button",attrs:{item:t.actionLink}})],1):t._e()])],1),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.24"}},[t.recoShowModule&&t.$frontmatter.features&&t.$frontmatter.features.length?a("div",{staticClass:"features"},t._l(t.$frontmatter.features,(function(e,n){return a("div",{key:n,staticClass:"feature"},[a("h2",[t._v(t._s(e.title))]),t._v(" "),a("p",[t._v(t._s(e.details))])])})),0):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.32"}},[a("Content",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}],staticClass:"home-center",attrs:{custom:""}})],1)],1)}),[],!1,null,null,null).exports,u=a(6),p=(a(67),a(441)),f=(a(37),a(458)),g=a.n(f),d=a(93),m=function(){var t=Object(s.a)(),e=Object(n.g)(!0),a=Object(n.f)({left:0,top:0});return Object(n.d)((function(){e.value=!/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)})),{popupWindowStyle:a,showDetail:function(n){var r=n.target;r.querySelector(".popup-window-wrapper").style.display="block";var o=r.querySelector(".popup-window"),s=document.querySelector(".info-wrapper"),i=r.clientWidth,c=o.clientWidth,l=o.clientHeight;if(e)a.left=(i-c)/2+"px",a.top=-l+"px",s.style.overflow="visible",t.$nextTick((function(){!function(t){var e=document.body.offsetWidth,n=t.getBoundingClientRect(),r=e-(n.x+n.width);if(r<0){var o=t.offsetLeft;a.left=o+r+"px"}}(o)}));else{var u=function(t){var e=document,a=t.getBoundingClientRect(),n=a.left,r=a.top;return{left:n+=e.documentElement.scrollLeft||e.body.scrollLeft,top:r+=e.documentElement.scrollTop||e.body.scrollTop}};s.style.overflow="hidden";var p=u(r).left-u(s).left;a.left=-p+(s.clientWidth-o.clientWidth)/2+"px",a.top=-l+"px"}},hideDetail:function(t){t.target.querySelector(".popup-window-wrapper").style.display="none"}}},h=Object(n.b)({setup:function(t,e){var a=Object(s.a)(),r=m(),o=r.popupWindowStyle,i=r.showDetail,c=r.hideDetail;return{dataAddColor:Object(n.a)((function(){var t=(a&&a.$themeConfig).friendLink;return(void 0===t?[]:t).map((function(t){return t.color=Object(d.b)(),t}))})),popupWindowStyle:o,showDetail:i,hideDetail:c,getImgUrl:function(t){var e=t.logo,n=void 0===e?"":e,r=t.email,o=void 0===r?"":r;return n&&/^http/.test(n)?n:n&&!/^http/.test(n)?a.$withBase(n):"//1.gravatar.com/avatar/".concat(g()(o||""),"?s=50&d=mm&r=x")}}}}),v=(a(506),Object(c.a)(h,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"friend-link-wrapper"},t._l(t.dataAddColor,(function(e,n){return a("div",{key:n,staticClass:"friend-link-item",attrs:{target:"_blank"},on:{mouseenter:function(e){return t.showDetail(e)},mouseleave:function(e){return t.hideDetail(e)}}},[a("span",{staticClass:"list-style",style:{backgroundColor:e.color}}),t._v("\n "+t._s(e.title)+"\n "),a("transition",{attrs:{name:"fade"}},[a("div",{staticClass:"popup-window-wrapper"},[a("div",{ref:"popupWindow",refInFor:!0,staticClass:"popup-window",style:t.popupWindowStyle},[a("div",{staticClass:"logo"},[a("img",{attrs:{src:t.getImgUrl(e)}})]),t._v(" "),a("div",{staticClass:"info"},[a("div",{staticClass:"title"},[a("h4",[t._v(t._s(e.title))]),t._v(" "),a("a",{staticClass:"btn-go",style:{backgroundColor:e.color},attrs:{href:e.link,target:"_blank"}},[t._v("GO")])]),t._v(" "),e.desc?a("p",[t._v(t._s(e.desc))]):t._e()])])])])],1)})),0)}),[],!1,null,"165dc218",null).exports),_=a(436),b=a(476),C=Object(n.b)({components:{NoteAbstract:_.a,TagList:p.a,FriendLink:v,ModuleTransition:o.a,PersonalInfo:b.a,RecoIcon:o.b},setup:function(t,e){var r=Object(s.a)(),o=Object(n.f)({recoShow:!1,heroHeight:0}),i=Object(n.a)((function(){return r&&r.$parent.recoShowModule})),c=Object(n.a)((function(){return r.$frontmatter.heroImageStyle||{}})),l=Object(n.a)((function(){var t=r.$frontmatter.bgImage?r.$withBase(r.$frontmatter.bgImage):a(507),e={textAlign:"center",overflow:"hidden",background:"url(".concat(t,") center/cover no-repeat")},n=r.$frontmatter.bgImageStyle;return n?Object(u.a)(Object(u.a)({},e),n):e}));return Object(n.d)((function(){o.heroHeight=document.querySelector(".hero").clientHeight,o.recoShow=!0})),Object(u.a)(Object(u.a)({recoShowModule:i,heroImageStyle:c,bgImageStyle:l},Object(n.h)(o)),{},{getOneColor:d.b})},methods:{paginationChange:function(t){var e=this;setTimeout((function(){window.scrollTo(0,e.heroHeight)}),100)},getPagesByTags:function(t){this.$router.push({path:t.path})}}}),w=(a(508),Object(c.a)(C,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"home-blog"},[a("div",{staticClass:"hero",style:Object.assign({},t.bgImageStyle)},[a("div",[a("ModuleTransition",[t.recoShowModule&&t.$frontmatter.heroImage?a("img",{staticClass:"hero-img",style:t.heroImageStyle||{},attrs:{src:t.$withBase(t.$frontmatter.heroImage),alt:"hero"}}):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.04"}},[t.recoShowModule&&null!==t.$frontmatter.heroText?a("h1",[t._v("\n "+t._s(t.$frontmatter.heroText||t.$title||"vuePress-theme-reco")+"\n ")]):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.08"}},[t.recoShowModule&&null!==t.$frontmatter.tagline?a("p",{staticClass:"description"},[t._v("\n "+t._s(t.$frontmatter.tagline||t.$description||"Welcome to your vuePress-theme-reco site")+"\n ")]):t._e()])],1)]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.16"}},[a("div",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}],staticClass:"home-blog-wrapper"},[a("div",{staticClass:"blog-list"},[a("note-abstract",{attrs:{data:t.$recoPosts},on:{paginationChange:t.paginationChange}})],1),t._v(" "),a("div",{staticClass:"info-wrapper"},[a("PersonalInfo"),t._v(" "),a("h4",[a("reco-icon",{attrs:{icon:"reco-category"}}),t._v(" "+t._s(t.$recoLocales.category))],1),t._v(" "),a("ul",{staticClass:"category-wrapper"},t._l(this.$categories.list,(function(e,n){return a("li",{key:n,staticClass:"category-item"},[a("router-link",{attrs:{to:e.path}},[a("span",{staticClass:"category-name"},[t._v(t._s(e.name))]),t._v(" "),a("span",{staticClass:"post-num",style:{backgroundColor:t.getOneColor()}},[t._v(t._s(e.pages.length))])])],1)})),0),t._v(" "),a("hr"),t._v(" "),0!==t.$tags.list.length?a("h4",[a("reco-icon",{attrs:{icon:"reco-tag"}}),t._v(" "+t._s(t.$recoLocales.tag))],1):t._e(),t._v(" "),a("TagList",{on:{getCurrentTag:t.getPagesByTags}}),t._v(" "),t.$themeConfig.friendLink&&0!==t.$themeConfig.friendLink.length?a("h4",[a("reco-icon",{attrs:{icon:"reco-friend"}}),t._v(" "+t._s(t.$recoLocales.friendLink))],1):t._e(),t._v(" "),a("FriendLink")],1)])]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.24"}},[a("Content",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}],staticClass:"home-center",attrs:{custom:""}})],1)],1)}),[],!1,null,null,null).exports),$=(a(38),a(48),a(432)),y=a(39),O=a(65),S=a(50),j=(a(131),Object(n.b)({setup:function(t,e){var a=Object(s.a)();return{headers:Object(n.a)((function(){return a.$showSubSideBar?a.$page.headers:[]})),isLinkActive:function(t){var e=Object(y.e)(a.$route,a.$page.path+"#"+t.slug);return e&&setTimeout((function(){document.querySelector(".reco-side-".concat(t.slug)).scrollIntoView()}),300),e}}},render:function(t){var e=this;return t("ul",{class:{"sub-sidebar-wrapper":!0},style:{width:this.headers.length>0?"12rem":"0"}},Object(S.a)(this.headers.map((function(a){return t("li",{class:Object(O.a)({active:e.isLinkActive(a)},"level-".concat(a.level),!0),attr:{key:a.title}},[t("router-link",{class:Object(O.a)({"sidebar-link":!0},"reco-side-".concat(a.slug),!0),props:{to:"".concat(e.$page.path,"#").concat(a.slug)}},a.title)])}))))}})),k=(a(509),Object(c.a)(j,void 0,void 0,!1,null,"cb1513f6",null).exports);function T(t,e,a){var n=[];!function t(e,a){for(var n=0,r=e.length;n<r;n++)"group"===e[n].type?t(e[n].children||[],a):a.push(e[n])}(e,n);for(var r=0;r<n.length;r++){var o=n[r];if("page"===o.type&&o.path===decodeURIComponent(t.path))return n[r+a]}}var x=Object(n.b)({components:{PageInfo:$.a,ModuleTransition:o.a,SubSidebar:k},props:["sidebarItems"],setup:function(t,e){var a=Object(s.a)(),r=Object(n.h)(t).sidebarItems,o=Object(n.a)((function(){return a.$parent.recoShowModule})),i=Object(n.a)((function(){var t=a.$frontmatter.isShowComments,e=(a.$themeConfig.valineConfig||{showComment:!0}).showComment;return!1!==e&&!1!==t||!1===e&&!0===t})),c=Object(n.a)((function(){var t=a||{},e=t.$themeConfig.valineConfig,n=t.$themeLocaleConfig.valineConfig||e;return n&&0!=n.visitor})),l=Object(n.a)((function(){return!1!==a.$themeConfig.lastUpdated&&a.$page.lastUpdated})),u=Object(n.a)((function(){return"string"==typeof a.$themeLocaleConfig.lastUpdated?a.$themeLocaleConfig.lastUpdated:"string"==typeof a.$themeConfig.lastUpdated?a.$themeConfig.lastUpdated:"Last Updated"})),p=Object(n.a)((function(){var t,e,n=a.$frontmatter.prev;return!1===n?void 0:n?Object(y.k)(a.$site.pages,n,a.$route.path):(t=a.$page,e=r.value,T(t,e,-1))})),f=Object(n.a)((function(){var t,e,n=a.$frontmatter.next;return!1===f?void 0:n?Object(y.k)(a.$site.pages,n,a.$route.path):(t=a.$page,e=r.value,T(t,e,1))})),g=Object(n.a)((function(){if(!1===a.$frontmatter.editLink)return!1;var t=a.$themeConfig,e=t.repo,n=t.editLinks,r=t.docsDir,o=void 0===r?"":r,s=t.docsBranch,i=void 0===s?"master":s,c=t.docsRepo,l=void 0===c?e:c;return l&&n&&a.$page.relativePath?function(t,e,a,n,r){if(/bitbucket.org/.test(t)){return(y.i.test(e)?e:t).replace(y.c,"")+"/src"+"/".concat(n,"/")+(a?a.replace(y.c,"")+"/":"")+r+"?mode=edit&spa=0&at=".concat(n,"&fileviewer=file-view-default")}return(y.i.test(e)?e:"https://github.com/".concat(e)).replace(y.c,"")+"/edit"+"/".concat(n,"/")+(a?a.replace(y.c,"")+"/":"")+r}(e,l,o,i,a.$page.relativePath):""})),d=Object(n.a)((function(){return a.$themeLocaleConfig.editLinkText||a.$themeConfig.editLinkText||"Edit this page"})),m=Object(n.a)((function(){return a.$showSubSideBar?{}:{paddingRight:"0"}}));return{recoShowModule:o,shouldShowComments:i,showAccessNumber:c,lastUpdated:l,lastUpdatedText:u,prev:p,next:f,editLink:g,editLinkText:d,pageStyle:m}}}),I=(a(510),Object(c.a)(x,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("main",{staticClass:"page",style:t.pageStyle},[a("ModuleTransition",{attrs:{delay:"0.08"}},[a("section",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}]},[a("div",{staticClass:"page-title"},[a("h1",{staticClass:"title"},[t._v(t._s(t.$page.title))]),t._v(" "),a("PageInfo",{attrs:{pageInfo:t.$page,showAccessNumber:t.showAccessNumber}})],1),t._v(" "),a("Content",{staticClass:"theme-reco-content"})],1)]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.16"}},[t.recoShowModule?a("footer",{staticClass:"page-edit"},[t.editLink?a("div",{staticClass:"edit-link"},[a("a",{attrs:{href:t.editLink,target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.editLinkText))]),t._v(" "),a("OutboundLink")],1):t._e(),t._v(" "),t.lastUpdated?a("div",{staticClass:"last-updated"},[a("span",{staticClass:"prefix"},[t._v(t._s(t.lastUpdatedText)+": ")]),t._v(" "),a("span",{staticClass:"time"},[t._v(t._s(t.lastUpdated))])]):t._e()]):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.24"}},[t.recoShowModule&&(t.prev||t.next)?a("div",{staticClass:"page-nav"},[a("p",{staticClass:"inner"},[t.prev?a("span",{staticClass:"prev"},[t.prev?a("router-link",{staticClass:"prev",attrs:{to:t.prev.path}},[t._v("\n "+t._s(t.prev.title||t.prev.path)+"\n ")]):t._e()],1):t._e(),t._v(" "),t.next?a("span",{staticClass:"next"},[t.next?a("router-link",{attrs:{to:t.next.path}},[t._v("\n "+t._s(t.next.title||t.next.path)+"\n ")]):t._e()],1):t._e()])]):t._e()]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.32"}},[t.recoShowModule?a("Comments",{attrs:{isShowComments:t.shouldShowComments}}):t._e()],1),t._v(" "),a("ModuleTransition",[t.recoShowModule?a("SubSidebar",{staticClass:"side-bar"}):t._e()],1)],1)}),[],!1,null,null,null).exports),M=a(511),P=Object(n.b)({components:{RecoIcon:o.b},setup:function(t,e){var a=Object(s.a)(),r=Object(n.a)((function(){var t=a.$themeConfig.valineConfig,e=a.$themeLocaleConfig.valineConfig||t;return e&&0!=e.visitor}));return{version:M.a,showAccessNumber:r}}}),L=(a(512),Object(c.a)(P,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"footer-wrapper"},[a("span",[a("reco-icon",{attrs:{icon:"reco-theme"}}),t._v(" "),a("a",{attrs:{target:"blank",href:"https://vuepress-theme-reco.recoluan.com"}},[t._v(t._s("vuepress-theme-reco@"+t.version))])],1),t._v(" "),t.$themeConfig.record?a("span",[a("reco-icon",{attrs:{icon:"reco-beian"}}),t._v(" "),a("a",{attrs:{href:t.$themeConfig.recordLink||"#"}},[t._v(t._s(t.$themeConfig.record))])],1):t._e(),t._v(" "),a("span",[a("reco-icon",{attrs:{icon:"reco-copyright"}}),t._v(" "),a("a",[t.$themeConfig.author?a("span",[t._v(t._s(t.$themeConfig.author))]):t._e(),t._v("\n   \n "),t.$themeConfig.startYear&&t.$themeConfig.startYear!=(new Date).getFullYear()?a("span",[t._v(t._s(t.$themeConfig.startYear)+" - ")]):t._e(),t._v("\n "+t._s((new Date).getFullYear())+"\n ")])],1),t._v(" "),a("span",{directives:[{name:"show",rawName:"v-show",value:t.showAccessNumber,expression:"showAccessNumber"}]},[a("reco-icon",{attrs:{icon:"reco-eye"}}),t._v(" "),a("AccessNumber",{attrs:{idVal:"/"}})],1),t._v(" "),t.$themeConfig.cyberSecurityRecord?a("p",{staticClass:"cyber-security"},[a("img",{attrs:{src:"https://img.alicdn.com/tfs/TB1..50QpXXXXX7XpXXXXXXXXXX-40-40.png",alt:""}}),t._v(" "),a("a",{attrs:{href:t.$themeConfig.cyberSecurityLink||"#"}},[t._v(t._s(t.$themeConfig.cyberSecurityRecord))])]):t._e(),t._v(" "),a("Comments",{attrs:{isShowComments:!1}})],1)}),[],!1,null,"c3cf170c",null).exports),N=a(440),A=a(437),B=Object(n.b)({mixins:[A.a],components:{HomeBlog:w,Home:l,Page:I,Common:N.a,Footer:L},setup:function(t,e){var a=Object(s.a)();return{sidebarItems:Object(n.a)((function(){var t=a.$page,e=a.$site,n=a.$localePath;return t?Object(y.l)(t,t.regularPath,e,n):[]})),homeCom:Object(n.a)((function(){var t=(a.$themeConfig||{}).type;return t?"blog"==t?"HomeBlog":t:"Home"}))}}}),D=(a(513),a(514),Object(c.a)(B,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("Common",{attrs:{sidebarItems:t.sidebarItems,showModule:t.recoShowModule}},[t.$frontmatter.home?a(t.homeCom,{tag:"component"}):a("Page",{attrs:{"sidebar-items":t.sidebarItems}}),t._v(" "),t.$frontmatter.home?a("Footer",{staticClass:"footer"}):t._e()],1)}),[],!1,null,null,null));e.default=D.exports}}]); \ No newline at end of file diff --git a/assets/js/30.28a79af9.js b/assets/js/30.28a79af9.js new file mode 100644 index 0000000..162cb83 --- /dev/null +++ b/assets/js/30.28a79af9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{569:function(t,s,a){"use strict";a.r(s);var n=a(9),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"video-鼠标移动预览"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#video-鼠标移动预览"}},[t._v("#")]),t._v(" video 鼠标移动预览")]),t._v(" "),a("blockquote",[a("p",[t._v("B 站图片接口\nhttps://api.bilibili.com/x/player/videoshot?aid=14326240")])]),t._v(" "),a("div",{staticClass:"language-json line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ttl"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"data"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pvdata"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"//i0.hdslb.com/bfs/videoshot/23378913.bin"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"img_x_len"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"img_y_len"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"img_x_size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("160")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"img_y_size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("90")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"image"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"//i0.hdslb.com/bfs/videoshot/23378913.jpg"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"//i0.hdslb.com/bfs/videoshot/23378913-1.jpg"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"//i0.hdslb.com/bfs/videoshot/23378913-2.jpg"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"index"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br"),a("span",{staticClass:"line-number"},[t._v("8")]),a("br"),a("span",{staticClass:"line-number"},[t._v("9")]),a("br"),a("span",{staticClass:"line-number"},[t._v("10")]),a("br"),a("span",{staticClass:"line-number"},[t._v("11")]),a("br"),a("span",{staticClass:"line-number"},[t._v("12")]),a("br"),a("span",{staticClass:"line-number"},[t._v("13")]),a("br"),a("span",{staticClass:"line-number"},[t._v("14")]),a("br"),a("span",{staticClass:"line-number"},[t._v("15")]),a("br"),a("span",{staticClass:"line-number"},[t._v("16")]),a("br"),a("span",{staticClass:"line-number"},[t._v("17")]),a("br"),a("span",{staticClass:"line-number"},[t._v("18")]),a("br")])]),a("table",[a("thead",[a("tr",[a("th",[t._v("字段")]),t._v(" "),a("th",[t._v("含义")]),t._v(" "),a("th",[t._v("详细")]),t._v(" "),a("th",[t._v("举例")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[t._v("data")]),t._v(" "),a("td",[t._v("缩略图")]),t._v(" "),a("td"),t._v(" "),a("td")]),t._v(" "),a("tr",[a("td",[t._v("data.pvdata")]),t._v(" "),a("td",[t._v("一个二进制文件")]),t._v(" "),a("td",[t._v("缩略图,并不是每一秒都对应一张缩略图,而是每一段对应一张,这个字段应该是时间段与缩略图的对应方式")]),t._v(" "),a("td",[t._v("//i0.hdslb.com/bfs/videoshot/89359010.bin")])]),t._v(" "),a("tr",[a("td",[t._v("data.img_x_len")]),t._v(" "),a("td",[t._v("每张雪碧图 x 方向图片数量")]),t._v(" "),a("td",[t._v("雪碧图是一个 10*10 的网格")]),t._v(" "),a("td",[t._v("10")])]),t._v(" "),a("tr",[a("td",[t._v("data.img_y_len")]),t._v(" "),a("td",[t._v("每张雪碧图 y 方向图片数量")]),t._v(" "),a("td",[t._v("雪碧图是一个 10*10 的网格")]),t._v(" "),a("td",[t._v("10")])]),t._v(" "),a("tr",[a("td",[t._v("data.img_x_size")]),t._v(" "),a("td",[t._v("单个缩略图图片的尺寸")]),t._v(" "),a("td",[t._v("x 轴")]),t._v(" "),a("td",[t._v("160")])]),t._v(" "),a("tr",[a("td",[t._v("data.img_y_size")]),t._v(" "),a("td",[t._v("单个缩略图图片的尺寸")]),t._v(" "),a("td",[t._v("y 轴")]),t._v(" "),a("td",[t._v("90")])]),t._v(" "),a("tr",[a("td",[t._v("data.image")]),t._v(" "),a("td",[t._v("雪碧图形式的所有缩略图")]),t._v(" "),a("td",[t._v("是一个数组,一次拿到所有的缩略图")]),t._v(" "),a("td",[t._v('["//i0.hdslb.com/bfs/videoshot/89359010.jpg"]')])])])]),t._v(" "),a("h2",{attrs:{id:"代码"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#代码"}},[t._v("#")]),t._v(" 代码")]),t._v(" "),a("div",{staticClass:"language-html line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token doctype"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<!")]),a("span",{pre:!0,attrs:{class:"token doctype-tag"}},[t._v("DOCTYPE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token name"}},[t._v("html")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("html")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("head")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("charset")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("utf-8"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("title")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("title")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("link")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("rel")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("stylesheet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("href")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("./resources/font-awesome-4.7.0/css/font-awesome.min.css"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("link")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("rel")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("stylesheet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text/css"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("href")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("./select/select.css"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text/css"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token selector"}},[t._v("#container")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("position")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" absolute"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("top")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 0"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("left")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 0"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("right")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 0"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("bottom")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 0"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("margin")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" auto"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("width")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 170px"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("height")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 95px"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-image")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token url"}},[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("url")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("20210223214102298jpg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" //背景图图片\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("background-size")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" 1700px"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("head")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("body")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("div")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("id")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("div")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" container "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"#container"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n window"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onload")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 鼠标移动到指定box上时,触发事件")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//获取指定div元素")]),t._v("\n container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("onmousemove")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("event")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"事件触发!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 获取盒子的位置")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" boxX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offsetLeft"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" boxY "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("offsetTop"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 获取鼠标的坐标")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" pageX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pageX"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" pageY "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" event"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pageY"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//计算鼠标在盒子中的坐标")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" inBoxX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" pageX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" boxX"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" inBoxY "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" pageY "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" boxY"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// console.log("盒子中的坐标:x--\x3e"+inBoxX+"--y--\x3e"+inBoxY);')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//计算X轴,并移动图片")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//每移动5个值就改变一次图片")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inBoxX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//计算显示第几个图片")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" imageIndex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inBoxX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"当前显示第几张图片:"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" imageIndex"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//计算显示图片在大图中的位置")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//计算显示图片的X轴(计算的是大图中的X轴)")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" imageX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("170")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("imageIndex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//计算显示图片的Y轴(计算的是大图中的Y轴)")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" imageY "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("95")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("parseInt")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("imageIndex "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"imageX:"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" imageX"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"imageY:"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" imageY"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//修改背景图片")]),t._v("\n container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("style"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("backgroundPosition "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"-"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" imageX "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"px"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('" -"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" imageY "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"px"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("body")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("html")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br"),a("span",{staticClass:"line-number"},[t._v("8")]),a("br"),a("span",{staticClass:"line-number"},[t._v("9")]),a("br"),a("span",{staticClass:"line-number"},[t._v("10")]),a("br"),a("span",{staticClass:"line-number"},[t._v("11")]),a("br"),a("span",{staticClass:"line-number"},[t._v("12")]),a("br"),a("span",{staticClass:"line-number"},[t._v("13")]),a("br"),a("span",{staticClass:"line-number"},[t._v("14")]),a("br"),a("span",{staticClass:"line-number"},[t._v("15")]),a("br"),a("span",{staticClass:"line-number"},[t._v("16")]),a("br"),a("span",{staticClass:"line-number"},[t._v("17")]),a("br"),a("span",{staticClass:"line-number"},[t._v("18")]),a("br"),a("span",{staticClass:"line-number"},[t._v("19")]),a("br"),a("span",{staticClass:"line-number"},[t._v("20")]),a("br"),a("span",{staticClass:"line-number"},[t._v("21")]),a("br"),a("span",{staticClass:"line-number"},[t._v("22")]),a("br"),a("span",{staticClass:"line-number"},[t._v("23")]),a("br"),a("span",{staticClass:"line-number"},[t._v("24")]),a("br"),a("span",{staticClass:"line-number"},[t._v("25")]),a("br"),a("span",{staticClass:"line-number"},[t._v("26")]),a("br"),a("span",{staticClass:"line-number"},[t._v("27")]),a("br"),a("span",{staticClass:"line-number"},[t._v("28")]),a("br"),a("span",{staticClass:"line-number"},[t._v("29")]),a("br"),a("span",{staticClass:"line-number"},[t._v("30")]),a("br"),a("span",{staticClass:"line-number"},[t._v("31")]),a("br"),a("span",{staticClass:"line-number"},[t._v("32")]),a("br"),a("span",{staticClass:"line-number"},[t._v("33")]),a("br"),a("span",{staticClass:"line-number"},[t._v("34")]),a("br"),a("span",{staticClass:"line-number"},[t._v("35")]),a("br"),a("span",{staticClass:"line-number"},[t._v("36")]),a("br"),a("span",{staticClass:"line-number"},[t._v("37")]),a("br"),a("span",{staticClass:"line-number"},[t._v("38")]),a("br"),a("span",{staticClass:"line-number"},[t._v("39")]),a("br"),a("span",{staticClass:"line-number"},[t._v("40")]),a("br"),a("span",{staticClass:"line-number"},[t._v("41")]),a("br"),a("span",{staticClass:"line-number"},[t._v("42")]),a("br"),a("span",{staticClass:"line-number"},[t._v("43")]),a("br"),a("span",{staticClass:"line-number"},[t._v("44")]),a("br"),a("span",{staticClass:"line-number"},[t._v("45")]),a("br"),a("span",{staticClass:"line-number"},[t._v("46")]),a("br"),a("span",{staticClass:"line-number"},[t._v("47")]),a("br"),a("span",{staticClass:"line-number"},[t._v("48")]),a("br"),a("span",{staticClass:"line-number"},[t._v("49")]),a("br"),a("span",{staticClass:"line-number"},[t._v("50")]),a("br"),a("span",{staticClass:"line-number"},[t._v("51")]),a("br"),a("span",{staticClass:"line-number"},[t._v("52")]),a("br"),a("span",{staticClass:"line-number"},[t._v("53")]),a("br"),a("span",{staticClass:"line-number"},[t._v("54")]),a("br"),a("span",{staticClass:"line-number"},[t._v("55")]),a("br"),a("span",{staticClass:"line-number"},[t._v("56")]),a("br"),a("span",{staticClass:"line-number"},[t._v("57")]),a("br"),a("span",{staticClass:"line-number"},[t._v("58")]),a("br"),a("span",{staticClass:"line-number"},[t._v("59")]),a("br"),a("span",{staticClass:"line-number"},[t._v("60")]),a("br"),a("span",{staticClass:"line-number"},[t._v("61")]),a("br"),a("span",{staticClass:"line-number"},[t._v("62")]),a("br"),a("span",{staticClass:"line-number"},[t._v("63")]),a("br"),a("span",{staticClass:"line-number"},[t._v("64")]),a("br"),a("span",{staticClass:"line-number"},[t._v("65")]),a("br"),a("span",{staticClass:"line-number"},[t._v("66")]),a("br")])]),a("blockquote",[a("p",[t._v("参考地址\n"),a("a",{attrs:{href:"https://blog.csdn.net/Mr_FenKuan/article/details/114003333?spm=1001.2101.3001.6650.7&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-7-114003333-blog-90724799.topblog&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-7-114003333-blog-90724799.topblog&utm_relevant_index=12",target:"_blank",rel:"noopener noreferrer"}},[t._v("仿 BiliBili 视屏缩略图实现"),a("OutboundLink")],1)])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/31.43bc648e.js b/assets/js/31.43bc648e.js new file mode 100644 index 0000000..0516619 --- /dev/null +++ b/assets/js/31.43bc648e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{571:function(t,s,a){"use strict";a.r(s);var n=a(9),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("div",{staticClass:"language-html line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-html"}},[a("code",[a("span",{pre:!0,attrs:{class:"token doctype"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<!")]),a("span",{pre:!0,attrs:{class:"token doctype-tag"}},[t._v("DOCTYPE")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token name"}},[t._v("html")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("html")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("lang")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("en"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("head")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("charset")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("UTF-8"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("viewport"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("width=device-width, initial-scale=1.0"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("meta")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("http-equiv")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("X-UA-Compatible"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("content")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("ie=edge"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("title")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("auto complete"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("title")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token style"}},[a("span",{pre:!0,attrs:{class:"token language-css"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token selector"}},[t._v("bdi")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("color")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("rgb")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("0"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 136"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" 255"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token selector"}},[t._v("li")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v("list-style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" none"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("style")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("head")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("body")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("input")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("inp"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("text"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("/>")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("section")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("ul")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("class")]),a("span",{pre:!0,attrs:{class:"token attr-value"}},[a("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("ul")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("section")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("body")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),a("span",{pre:!0,attrs:{class:"token script"}},[a("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("debounce")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("fn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" timeout "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("args")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("clearTimeout")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("t"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n t "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("setTimeout")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("apply")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" args"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" timeout"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("memorize")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" cache "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Map")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("name")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerHTML "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cache"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerHTML "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" cache"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("get")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" res "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("fn")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fn"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n cache"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("name"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n container"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("innerHTML "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("function")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("handleInput")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("value")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" reg "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("RegExp")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token template-string"}},[a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\\(")]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("\\)")]),a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" search "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("reduce")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cur")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reg"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("test")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cur"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" match "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegExp"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("$1"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token template-string"}},[a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("<li>")]),a("span",{pre:!0,attrs:{class:"token interpolation"}},[a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("cur"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("replace")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("match"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<bdi>$&</bdi>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("</li>")]),a("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" res"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" search"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"上海野生动物园"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"上饶野生动物园"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"北京巷子"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"上海中心"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"上海黄埔江"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"迪士尼上海"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"陆家嘴上海中心"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" container "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('".container"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" memorizeInput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("memorize")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("handleInput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n document"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("querySelector")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('".inp"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("addEventListener")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"input"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("debounce")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[t._v("e")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("memorizeInput")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("target"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n ")])]),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("script")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token tag"}},[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("</")]),t._v("html")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v("\n")])]),t._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[t._v("1")]),a("br"),a("span",{staticClass:"line-number"},[t._v("2")]),a("br"),a("span",{staticClass:"line-number"},[t._v("3")]),a("br"),a("span",{staticClass:"line-number"},[t._v("4")]),a("br"),a("span",{staticClass:"line-number"},[t._v("5")]),a("br"),a("span",{staticClass:"line-number"},[t._v("6")]),a("br"),a("span",{staticClass:"line-number"},[t._v("7")]),a("br"),a("span",{staticClass:"line-number"},[t._v("8")]),a("br"),a("span",{staticClass:"line-number"},[t._v("9")]),a("br"),a("span",{staticClass:"line-number"},[t._v("10")]),a("br"),a("span",{staticClass:"line-number"},[t._v("11")]),a("br"),a("span",{staticClass:"line-number"},[t._v("12")]),a("br"),a("span",{staticClass:"line-number"},[t._v("13")]),a("br"),a("span",{staticClass:"line-number"},[t._v("14")]),a("br"),a("span",{staticClass:"line-number"},[t._v("15")]),a("br"),a("span",{staticClass:"line-number"},[t._v("16")]),a("br"),a("span",{staticClass:"line-number"},[t._v("17")]),a("br"),a("span",{staticClass:"line-number"},[t._v("18")]),a("br"),a("span",{staticClass:"line-number"},[t._v("19")]),a("br"),a("span",{staticClass:"line-number"},[t._v("20")]),a("br"),a("span",{staticClass:"line-number"},[t._v("21")]),a("br"),a("span",{staticClass:"line-number"},[t._v("22")]),a("br"),a("span",{staticClass:"line-number"},[t._v("23")]),a("br"),a("span",{staticClass:"line-number"},[t._v("24")]),a("br"),a("span",{staticClass:"line-number"},[t._v("25")]),a("br"),a("span",{staticClass:"line-number"},[t._v("26")]),a("br"),a("span",{staticClass:"line-number"},[t._v("27")]),a("br"),a("span",{staticClass:"line-number"},[t._v("28")]),a("br"),a("span",{staticClass:"line-number"},[t._v("29")]),a("br"),a("span",{staticClass:"line-number"},[t._v("30")]),a("br"),a("span",{staticClass:"line-number"},[t._v("31")]),a("br"),a("span",{staticClass:"line-number"},[t._v("32")]),a("br"),a("span",{staticClass:"line-number"},[t._v("33")]),a("br"),a("span",{staticClass:"line-number"},[t._v("34")]),a("br"),a("span",{staticClass:"line-number"},[t._v("35")]),a("br"),a("span",{staticClass:"line-number"},[t._v("36")]),a("br"),a("span",{staticClass:"line-number"},[t._v("37")]),a("br"),a("span",{staticClass:"line-number"},[t._v("38")]),a("br"),a("span",{staticClass:"line-number"},[t._v("39")]),a("br"),a("span",{staticClass:"line-number"},[t._v("40")]),a("br"),a("span",{staticClass:"line-number"},[t._v("41")]),a("br"),a("span",{staticClass:"line-number"},[t._v("42")]),a("br"),a("span",{staticClass:"line-number"},[t._v("43")]),a("br"),a("span",{staticClass:"line-number"},[t._v("44")]),a("br"),a("span",{staticClass:"line-number"},[t._v("45")]),a("br"),a("span",{staticClass:"line-number"},[t._v("46")]),a("br"),a("span",{staticClass:"line-number"},[t._v("47")]),a("br"),a("span",{staticClass:"line-number"},[t._v("48")]),a("br"),a("span",{staticClass:"line-number"},[t._v("49")]),a("br"),a("span",{staticClass:"line-number"},[t._v("50")]),a("br"),a("span",{staticClass:"line-number"},[t._v("51")]),a("br"),a("span",{staticClass:"line-number"},[t._v("52")]),a("br"),a("span",{staticClass:"line-number"},[t._v("53")]),a("br"),a("span",{staticClass:"line-number"},[t._v("54")]),a("br"),a("span",{staticClass:"line-number"},[t._v("55")]),a("br"),a("span",{staticClass:"line-number"},[t._v("56")]),a("br"),a("span",{staticClass:"line-number"},[t._v("57")]),a("br"),a("span",{staticClass:"line-number"},[t._v("58")]),a("br"),a("span",{staticClass:"line-number"},[t._v("59")]),a("br"),a("span",{staticClass:"line-number"},[t._v("60")]),a("br"),a("span",{staticClass:"line-number"},[t._v("61")]),a("br"),a("span",{staticClass:"line-number"},[t._v("62")]),a("br"),a("span",{staticClass:"line-number"},[t._v("63")]),a("br"),a("span",{staticClass:"line-number"},[t._v("64")]),a("br"),a("span",{staticClass:"line-number"},[t._v("65")]),a("br"),a("span",{staticClass:"line-number"},[t._v("66")]),a("br"),a("span",{staticClass:"line-number"},[t._v("67")]),a("br"),a("span",{staticClass:"line-number"},[t._v("68")]),a("br"),a("span",{staticClass:"line-number"},[t._v("69")]),a("br"),a("span",{staticClass:"line-number"},[t._v("70")]),a("br"),a("span",{staticClass:"line-number"},[t._v("71")]),a("br"),a("span",{staticClass:"line-number"},[t._v("72")]),a("br"),a("span",{staticClass:"line-number"},[t._v("73")]),a("br"),a("span",{staticClass:"line-number"},[t._v("74")]),a("br"),a("span",{staticClass:"line-number"},[t._v("75")]),a("br"),a("span",{staticClass:"line-number"},[t._v("76")]),a("br"),a("span",{staticClass:"line-number"},[t._v("77")]),a("br"),a("span",{staticClass:"line-number"},[t._v("78")]),a("br"),a("span",{staticClass:"line-number"},[t._v("79")]),a("br"),a("span",{staticClass:"line-number"},[t._v("80")]),a("br"),a("span",{staticClass:"line-number"},[t._v("81")]),a("br"),a("span",{staticClass:"line-number"},[t._v("82")]),a("br"),a("span",{staticClass:"line-number"},[t._v("83")]),a("br"),a("span",{staticClass:"line-number"},[t._v("84")]),a("br")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/32.1170f994.js b/assets/js/32.1170f994.js new file mode 100644 index 0000000..1220643 --- /dev/null +++ b/assets/js/32.1170f994.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{573:function(t,e,n){"use strict";n.r(e);var s=n(9),l=Object(s.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);e.default=l.exports}}]); \ No newline at end of file diff --git a/assets/js/33.9a36924c.js b/assets/js/33.9a36924c.js new file mode 100644 index 0000000..a02763f --- /dev/null +++ b/assets/js/33.9a36924c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{575:function(t,e,n){"use strict";n.r(e);var s=n(9),l=Object(s.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[e("p",[this._v("#你说什么")])])}),[],!1,null,null,null);e.default=l.exports}}]); \ No newline at end of file diff --git a/assets/js/34.2879f393.js b/assets/js/34.2879f393.js new file mode 100644 index 0000000..ebdaddc --- /dev/null +++ b/assets/js/34.2879f393.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{574:function(t,e,s){"use strict";s.r(e);var n=s(9),r=Object(n.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[e("h1",{attrs:{id:"vue-常见问题"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#vue-常见问题"}},[this._v("#")]),this._v(" Vue 常见问题")])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/35.83d3b502.js b/assets/js/35.83d3b502.js new file mode 100644 index 0000000..57644db --- /dev/null +++ b/assets/js/35.83d3b502.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{577:function(s,t,a){"use strict";a.r(t);var n=a(9),e=Object(n.a)({},(function(){var s=this,t=s.$createElement,a=s._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("p",[a("code",[s._v("nextTick")]),s._v(" 支持两种形式使用方式:")]),s._v(" "),a("ol",[a("li",[s._v("回调函数形式。")]),s._v(" "),a("li",[s._v("如果当前环节支持 "),a("code",[s._v("Promise")]),s._v(",还支持 "),a("code",[s._v("Promise.then")]),s._v(" 的形式。")])]),s._v(" "),a("div",{staticClass:"language-js line-numbers-mode"},[a("pre",{pre:!0,attrs:{class:"language-js"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" pending "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\ntimeFunc"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\ncallbacks"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//cb:执行的回调函数,context:执行上下文参数")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("nextTick")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("cb"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("context")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" _resolve"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n callbacks"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("push")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("cb"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("try")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("cb")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("call")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("catch")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("handleError")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("e"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("ctx"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("'nextTick"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("else")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("_resolve"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("_resolve")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("context"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!")]),s._v("pending"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n pending"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("timeFunc")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!")]),s._v("cb"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&&")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" Promise "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"undefind"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n rteurn "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Promise")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token parameter"}},[s._v("resolve")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v("_resolve"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v("resolve"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" isUsingMicroTask "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" Promise "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'undefined'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&&")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("isNative")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("Promise"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//判断1:是否原生支持Promise")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" p "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" Promise"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("resolve")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("timerFunc")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n p"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("then")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("flushCallbacks"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("isIOS"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("setTimeout")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("noop"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n isUsingMicroTask "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("true")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("else")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!")]),s._v("isIE "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&&")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" MutationObserver "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'undefined'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&&")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("isNative")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("MutationObserver"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("||")]),s._v("\n MutationObserver"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("toString")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("===")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'[object MutationObserverConstructor]'")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//判断2:是否原生支持MutationObserver")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" counter "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" observer "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("new")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("MutationObserver")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("flushCallbacks"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" textNode "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" document"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("createTextNode")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("counter"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n observer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("observe")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("textNode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token literal-property property"}},[s._v("characterData")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("true")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("timerFunc")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n counter "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("counter "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("+")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("%")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),s._v("\n textNode"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("data "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("counter"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n isUsingMicroTask "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("true")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("else")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("if")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("typeof")]),s._v(" setImmediate "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("!==")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v("'undefined'")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&&")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("isNative")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("setImmediate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//判断3:是否原生支持setImmediate")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("timerFunc")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("setImmediate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("flushCallbacks"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("else")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//判断4:上面都不行,直接用setTimeout")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function-variable function"}},[s._v("timerFunc")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("setTimeout")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("flushCallbacks"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("function")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("flushCallbacks")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n pending "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[s._v("false")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("const")]),s._v(" copies "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" callbacks"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("slice")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n callbacks"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("length "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("for")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("let")]),s._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),s._v(" copies"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),s._v("length"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" i"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("++")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n copies"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),s._v("i"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("nextTick")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"nextTick callback"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("nextTick")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("then")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=>")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n console"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[s._v("log")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"nextTick Promise"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v("\n")])]),s._v(" "),a("div",{staticClass:"line-numbers-wrapper"},[a("span",{staticClass:"line-number"},[s._v("1")]),a("br"),a("span",{staticClass:"line-number"},[s._v("2")]),a("br"),a("span",{staticClass:"line-number"},[s._v("3")]),a("br"),a("span",{staticClass:"line-number"},[s._v("4")]),a("br"),a("span",{staticClass:"line-number"},[s._v("5")]),a("br"),a("span",{staticClass:"line-number"},[s._v("6")]),a("br"),a("span",{staticClass:"line-number"},[s._v("7")]),a("br"),a("span",{staticClass:"line-number"},[s._v("8")]),a("br"),a("span",{staticClass:"line-number"},[s._v("9")]),a("br"),a("span",{staticClass:"line-number"},[s._v("10")]),a("br"),a("span",{staticClass:"line-number"},[s._v("11")]),a("br"),a("span",{staticClass:"line-number"},[s._v("12")]),a("br"),a("span",{staticClass:"line-number"},[s._v("13")]),a("br"),a("span",{staticClass:"line-number"},[s._v("14")]),a("br"),a("span",{staticClass:"line-number"},[s._v("15")]),a("br"),a("span",{staticClass:"line-number"},[s._v("16")]),a("br"),a("span",{staticClass:"line-number"},[s._v("17")]),a("br"),a("span",{staticClass:"line-number"},[s._v("18")]),a("br"),a("span",{staticClass:"line-number"},[s._v("19")]),a("br"),a("span",{staticClass:"line-number"},[s._v("20")]),a("br"),a("span",{staticClass:"line-number"},[s._v("21")]),a("br"),a("span",{staticClass:"line-number"},[s._v("22")]),a("br"),a("span",{staticClass:"line-number"},[s._v("23")]),a("br"),a("span",{staticClass:"line-number"},[s._v("24")]),a("br"),a("span",{staticClass:"line-number"},[s._v("25")]),a("br"),a("span",{staticClass:"line-number"},[s._v("26")]),a("br"),a("span",{staticClass:"line-number"},[s._v("27")]),a("br"),a("span",{staticClass:"line-number"},[s._v("28")]),a("br"),a("span",{staticClass:"line-number"},[s._v("29")]),a("br"),a("span",{staticClass:"line-number"},[s._v("30")]),a("br"),a("span",{staticClass:"line-number"},[s._v("31")]),a("br"),a("span",{staticClass:"line-number"},[s._v("32")]),a("br"),a("span",{staticClass:"line-number"},[s._v("33")]),a("br"),a("span",{staticClass:"line-number"},[s._v("34")]),a("br"),a("span",{staticClass:"line-number"},[s._v("35")]),a("br"),a("span",{staticClass:"line-number"},[s._v("36")]),a("br"),a("span",{staticClass:"line-number"},[s._v("37")]),a("br"),a("span",{staticClass:"line-number"},[s._v("38")]),a("br"),a("span",{staticClass:"line-number"},[s._v("39")]),a("br"),a("span",{staticClass:"line-number"},[s._v("40")]),a("br"),a("span",{staticClass:"line-number"},[s._v("41")]),a("br"),a("span",{staticClass:"line-number"},[s._v("42")]),a("br"),a("span",{staticClass:"line-number"},[s._v("43")]),a("br"),a("span",{staticClass:"line-number"},[s._v("44")]),a("br"),a("span",{staticClass:"line-number"},[s._v("45")]),a("br"),a("span",{staticClass:"line-number"},[s._v("46")]),a("br"),a("span",{staticClass:"line-number"},[s._v("47")]),a("br"),a("span",{staticClass:"line-number"},[s._v("48")]),a("br"),a("span",{staticClass:"line-number"},[s._v("49")]),a("br"),a("span",{staticClass:"line-number"},[s._v("50")]),a("br"),a("span",{staticClass:"line-number"},[s._v("51")]),a("br"),a("span",{staticClass:"line-number"},[s._v("52")]),a("br"),a("span",{staticClass:"line-number"},[s._v("53")]),a("br"),a("span",{staticClass:"line-number"},[s._v("54")]),a("br"),a("span",{staticClass:"line-number"},[s._v("55")]),a("br"),a("span",{staticClass:"line-number"},[s._v("56")]),a("br"),a("span",{staticClass:"line-number"},[s._v("57")]),a("br"),a("span",{staticClass:"line-number"},[s._v("58")]),a("br"),a("span",{staticClass:"line-number"},[s._v("59")]),a("br"),a("span",{staticClass:"line-number"},[s._v("60")]),a("br"),a("span",{staticClass:"line-number"},[s._v("61")]),a("br"),a("span",{staticClass:"line-number"},[s._v("62")]),a("br"),a("span",{staticClass:"line-number"},[s._v("63")]),a("br"),a("span",{staticClass:"line-number"},[s._v("64")]),a("br"),a("span",{staticClass:"line-number"},[s._v("65")]),a("br"),a("span",{staticClass:"line-number"},[s._v("66")]),a("br"),a("span",{staticClass:"line-number"},[s._v("67")]),a("br"),a("span",{staticClass:"line-number"},[s._v("68")]),a("br"),a("span",{staticClass:"line-number"},[s._v("69")]),a("br"),a("span",{staticClass:"line-number"},[s._v("70")]),a("br"),a("span",{staticClass:"line-number"},[s._v("71")]),a("br"),a("span",{staticClass:"line-number"},[s._v("72")]),a("br"),a("span",{staticClass:"line-number"},[s._v("73")]),a("br"),a("span",{staticClass:"line-number"},[s._v("74")]),a("br"),a("span",{staticClass:"line-number"},[s._v("75")]),a("br"),a("span",{staticClass:"line-number"},[s._v("76")]),a("br"),a("span",{staticClass:"line-number"},[s._v("77")]),a("br"),a("span",{staticClass:"line-number"},[s._v("78")]),a("br"),a("span",{staticClass:"line-number"},[s._v("79")]),a("br")])])])}),[],!1,null,null,null);t.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/4.4712295a.js b/assets/js/4.4712295a.js new file mode 100644 index 0000000..48e861c --- /dev/null +++ b/assets/js/4.4712295a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{425:function(t,e,a){},426:function(t,e,a){},427:function(t,e,a){},428:function(t,e,a){},429:function(t,e,a){"use strict";a(425)},430:function(t,e,a){},431:function(t,e,a){},432:function(t,e,a){"use strict";a(68);var n=a(130),r=a(424),o=a(423),c=Object(n.b)({components:{RecoIcon:r.b},props:{pageInfo:{type:Object,default:function(){return{}}},currentTag:{type:String,default:""},showAccessNumber:{type:Boolean,default:!1}},setup:function(t,e){var a=Object(o.a)();return{numStyle:{fontSize:".9rem",fontWeight:"normal",color:"#999"},goTags:function(t){a.$route.path!=="/tag/".concat(t,"/")&&a.$router.push({path:"/tag/".concat(t,"/")})},formatDateValue:function(t){return new Intl.DateTimeFormat(a.$lang).format(new Date(t))}}}}),s=(a(433),a(9)),i=Object(s.a)(c,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.pageInfo.frontmatter.author||t.$themeConfig.author?a("reco-icon",{attrs:{icon:"reco-account"}},[a("span",[t._v(t._s(t.pageInfo.frontmatter.author||t.$themeConfig.author))])]):t._e(),t._v(" "),t.pageInfo.frontmatter.date?a("reco-icon",{attrs:{icon:"reco-date"}},[a("span",[t._v(t._s(t.formatDateValue(t.pageInfo.frontmatter.date)))])]):t._e(),t._v(" "),!0===t.showAccessNumber?a("reco-icon",{attrs:{icon:"reco-eye"}},[a("AccessNumber",{attrs:{idVal:t.pageInfo.path,numStyle:t.numStyle}})],1):t._e(),t._v(" "),t.pageInfo.frontmatter.tags?a("reco-icon",{staticClass:"tags",attrs:{icon:"reco-tag"}},t._l(t.pageInfo.frontmatter.tags,(function(e,n){return a("span",{key:n,staticClass:"tag-item",class:{active:t.currentTag==e},on:{click:function(a){return a.stopPropagation(),t.goTags(e)}}},[t._v(t._s(e))])})),0):t._e()],1)}),[],!1,null,"f875f3fc",null);e.a=i.exports},433:function(t,e,a){"use strict";a(426)},434:function(t,e,a){"use strict";a(427)},435:function(t,e,a){"use strict";a(428)},436:function(t,e,a){"use strict";a(32);var n=a(130),r=(a(226),{methods:{_getStoragePage:function(){var t=window.location.pathname,e=JSON.parse(sessionStorage.getItem("currentPage"));return null===e||t!==e.path?(sessionStorage.setItem("currentPage",JSON.stringify({page:1,path:""})),1):parseInt(e.page)},_setStoragePage:function(t){var e=window.location.pathname;sessionStorage.setItem("currentPage",JSON.stringify({page:t,path:e}))}}}),o=a(424),c=a(432),s=Object(n.b)({components:{PageInfo:c.a,RecoIcon:o.b},props:["item","currentPage","currentTag"]}),i=(a(434),a(9)),u=Object(i.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-item",on:{click:function(e){return t.$router.push(t.item.path)}}},[t.item.frontmatter.sticky?a("reco-icon",{attrs:{icon:"reco-sticky"}}):t._e(),t._v(" "),a("div",{staticClass:"title"},[t.item.frontmatter.keys?a("reco-icon",{attrs:{icon:"reco-lock"}}):t._e(),t._v(" "),a("router-link",{attrs:{to:t.item.path}},[t._v(t._s(t.item.title))])],1),t._v(" "),a("div",{staticClass:"abstract",domProps:{innerHTML:t._s(t.item.excerpt)}}),t._v(" "),a("PageInfo",{attrs:{pageInfo:t.item,currentTag:t.currentTag}})],1)}),[],!1,null,"ff2c8be0",null).exports,g=a(423),l=Object(n.b)({mixins:[r],components:{NoteAbstractItem:u},props:["data","currentTag"],setup:function(t,e){var a=Object(g.a)(),r=Object(n.h)(t).data,o=Object(n.g)(1),c=Object(n.a)((function(){var t=(o.value-1)*a.$perPage,e=o.value*a.$perPage;return r.value.slice(t,e)}));return Object(n.d)((function(){o.value=a._getStoragePage()||1})),{currentPage:o,currentPageData:c,getCurrentPage:function(t){o.value=t,a._setStoragePage(t),e.emit("paginationChange",t)}}},watch:{$route:function(){this.currentPage=this._getStoragePage()||1}}}),p=(a(435),Object(i.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-wrapper"},[t._l(t.currentPageData,(function(e){return a("NoteAbstractItem",{key:e.path,attrs:{item:e,currentPage:t.currentPage,currentTag:t.currentTag}})})),t._v(" "),a("pagation",{staticClass:"pagation",attrs:{total:t.data.length,currentPage:t.currentPage},on:{getCurrentPage:t.getCurrentPage}})],2)}),[],!1,null,"6cc0658a",null));e.a=p.exports},438:function(t,e,a){"use strict";a(430)},439:function(t,e,a){"use strict";a(431)},441:function(t,e,a){"use strict";var n=a(50),r=(a(131),a(130)),o=a(93),c=a(423),s=Object(r.b)({props:{currentTag:{type:String,default:""}},setup:function(t,e){var a=Object(c.a)();return{tags:Object(r.a)((function(){return[{name:a.$recoLocales.all,path:"/tag/"}].concat(Object(n.a)(a.$tagesList))})),tagClick:function(t){e.emit("getCurrentTag",t)},getOneColor:o.b}}}),i=(a(439),a(9)),u=Object(i.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tags"},t._l(t.tags,(function(e,n){return a("span",{directives:[{name:"show",rawName:"v-show",value:!e.pages||e.pages&&e.pages.length>0,expression:"!item.pages || (item.pages && item.pages.length > 0)"}],key:n,class:{active:e.name==t.currentTag},style:{backgroundColor:t.getOneColor()},on:{click:function(a){return t.tagClick(e)}}},[t._v(t._s(e.name))])})),0)}),[],!1,null,"285c9a44",null);e.a=u.exports},471:function(t,e,a){},515:function(t,e,a){"use strict";a(471)},549:function(t,e,a){"use strict";a.r(e);a(67);var n=a(130),r=a(440),o=a(436),c=a(441),s=a(424),i=a(64),u=a(437),g=a(423),l=Object(n.b)({mixins:[u.a],components:{Common:r.a,NoteAbstract:o.a,TagList:c.a,ModuleTransition:s.a},setup:function(t,e){var a=Object(g.a)();return{posts:Object(n.a)((function(){var t=a.$currentTags.pages;return t=Object(i.a)(t),Object(i.c)(t),t})),getCurrentTag:function(t){e.emit("currentTag",t)},tagClick:function(t){a.$route.path!==t.path&&a.$router.push({path:t.path})},paginationChange:function(t){setTimeout((function(){window.scrollTo(0,0)}),100)}}}}),p=(a(429),a(438),a(515),a(9)),f=Object(p.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("Common",{staticClass:"tag-wrapper",attrs:{sidebar:!1}},[a("ModuleTransition",[a("TagList",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}],staticClass:"tags",attrs:{currentTag:t.$currentTags.key},on:{getCurrentTag:t.tagClick}})],1),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.08"}},[a("note-abstract",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}],staticClass:"list",attrs:{data:t.posts,currentTag:t.$currentTags.key},on:{paginationChange:t.paginationChange}})],1)],1)}),[],!1,null,"25a0fadc",null);e.default=f.exports}}]); \ No newline at end of file diff --git a/assets/js/5.aeeaf988.js b/assets/js/5.aeeaf988.js new file mode 100644 index 0000000..07689e9 --- /dev/null +++ b/assets/js/5.aeeaf988.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{425:function(t,e,a){},426:function(t,e,a){},427:function(t,e,a){},428:function(t,e,a){},429:function(t,e,a){"use strict";a(425)},430:function(t,e,a){},431:function(t,e,a){},432:function(t,e,a){"use strict";a(68);var n=a(130),r=a(424),o=a(423),c=Object(n.b)({components:{RecoIcon:r.b},props:{pageInfo:{type:Object,default:function(){return{}}},currentTag:{type:String,default:""},showAccessNumber:{type:Boolean,default:!1}},setup:function(t,e){var a=Object(o.a)();return{numStyle:{fontSize:".9rem",fontWeight:"normal",color:"#999"},goTags:function(t){a.$route.path!=="/tag/".concat(t,"/")&&a.$router.push({path:"/tag/".concat(t,"/")})},formatDateValue:function(t){return new Intl.DateTimeFormat(a.$lang).format(new Date(t))}}}}),s=(a(433),a(9)),i=Object(s.a)(c,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.pageInfo.frontmatter.author||t.$themeConfig.author?a("reco-icon",{attrs:{icon:"reco-account"}},[a("span",[t._v(t._s(t.pageInfo.frontmatter.author||t.$themeConfig.author))])]):t._e(),t._v(" "),t.pageInfo.frontmatter.date?a("reco-icon",{attrs:{icon:"reco-date"}},[a("span",[t._v(t._s(t.formatDateValue(t.pageInfo.frontmatter.date)))])]):t._e(),t._v(" "),!0===t.showAccessNumber?a("reco-icon",{attrs:{icon:"reco-eye"}},[a("AccessNumber",{attrs:{idVal:t.pageInfo.path,numStyle:t.numStyle}})],1):t._e(),t._v(" "),t.pageInfo.frontmatter.tags?a("reco-icon",{staticClass:"tags",attrs:{icon:"reco-tag"}},t._l(t.pageInfo.frontmatter.tags,(function(e,n){return a("span",{key:n,staticClass:"tag-item",class:{active:t.currentTag==e},on:{click:function(a){return a.stopPropagation(),t.goTags(e)}}},[t._v(t._s(e))])})),0):t._e()],1)}),[],!1,null,"f875f3fc",null);e.a=i.exports},433:function(t,e,a){"use strict";a(426)},434:function(t,e,a){"use strict";a(427)},435:function(t,e,a){"use strict";a(428)},436:function(t,e,a){"use strict";a(32);var n=a(130),r=(a(226),{methods:{_getStoragePage:function(){var t=window.location.pathname,e=JSON.parse(sessionStorage.getItem("currentPage"));return null===e||t!==e.path?(sessionStorage.setItem("currentPage",JSON.stringify({page:1,path:""})),1):parseInt(e.page)},_setStoragePage:function(t){var e=window.location.pathname;sessionStorage.setItem("currentPage",JSON.stringify({page:t,path:e}))}}}),o=a(424),c=a(432),s=Object(n.b)({components:{PageInfo:c.a,RecoIcon:o.b},props:["item","currentPage","currentTag"]}),i=(a(434),a(9)),u=Object(i.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-item",on:{click:function(e){return t.$router.push(t.item.path)}}},[t.item.frontmatter.sticky?a("reco-icon",{attrs:{icon:"reco-sticky"}}):t._e(),t._v(" "),a("div",{staticClass:"title"},[t.item.frontmatter.keys?a("reco-icon",{attrs:{icon:"reco-lock"}}):t._e(),t._v(" "),a("router-link",{attrs:{to:t.item.path}},[t._v(t._s(t.item.title))])],1),t._v(" "),a("div",{staticClass:"abstract",domProps:{innerHTML:t._s(t.item.excerpt)}}),t._v(" "),a("PageInfo",{attrs:{pageInfo:t.item,currentTag:t.currentTag}})],1)}),[],!1,null,"ff2c8be0",null).exports,g=a(423),l=Object(n.b)({mixins:[r],components:{NoteAbstractItem:u},props:["data","currentTag"],setup:function(t,e){var a=Object(g.a)(),r=Object(n.h)(t).data,o=Object(n.g)(1),c=Object(n.a)((function(){var t=(o.value-1)*a.$perPage,e=o.value*a.$perPage;return r.value.slice(t,e)}));return Object(n.d)((function(){o.value=a._getStoragePage()||1})),{currentPage:o,currentPageData:c,getCurrentPage:function(t){o.value=t,a._setStoragePage(t),e.emit("paginationChange",t)}}},watch:{$route:function(){this.currentPage=this._getStoragePage()||1}}}),p=(a(435),Object(i.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-wrapper"},[t._l(t.currentPageData,(function(e){return a("NoteAbstractItem",{key:e.path,attrs:{item:e,currentPage:t.currentPage,currentTag:t.currentTag}})})),t._v(" "),a("pagation",{staticClass:"pagation",attrs:{total:t.data.length,currentPage:t.currentPage},on:{getCurrentPage:t.getCurrentPage}})],2)}),[],!1,null,"6cc0658a",null));e.a=p.exports},438:function(t,e,a){"use strict";a(430)},439:function(t,e,a){"use strict";a(431)},441:function(t,e,a){"use strict";var n=a(50),r=(a(131),a(130)),o=a(93),c=a(423),s=Object(r.b)({props:{currentTag:{type:String,default:""}},setup:function(t,e){var a=Object(c.a)();return{tags:Object(r.a)((function(){return[{name:a.$recoLocales.all,path:"/tag/"}].concat(Object(n.a)(a.$tagesList))})),tagClick:function(t){e.emit("getCurrentTag",t)},getOneColor:o.b}}}),i=(a(439),a(9)),u=Object(i.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tags"},t._l(t.tags,(function(e,n){return a("span",{directives:[{name:"show",rawName:"v-show",value:!e.pages||e.pages&&e.pages.length>0,expression:"!item.pages || (item.pages && item.pages.length > 0)"}],key:n,class:{active:e.name==t.currentTag},style:{backgroundColor:t.getOneColor()},on:{click:function(a){return t.tagClick(e)}}},[t._v(t._s(e.name))])})),0)}),[],!1,null,"285c9a44",null);e.a=u.exports},472:function(t,e,a){},516:function(t,e,a){"use strict";a(472)},550:function(t,e,a){"use strict";a.r(e);a(67);var n=a(130),r=a(440),o=a(441),c=a(436),s=a(424),i=a(437),u=a(423),g=Object(n.b)({mixins:[i.a],components:{Common:r.a,NoteAbstract:c.a,TagList:o.a,ModuleTransition:s.a},setup:function(t,e){var a=Object(u.a)();return{tagClick:function(t){a.$route.path!==t.path&&a.$router.push({path:t.path})},paginationChange:function(t){setTimeout((function(){window.scrollTo(0,0)}),100)}}}}),l=(a(429),a(438),a(516),a(9)),p=Object(l.a)(g,(function(){var t=this.$createElement,e=this._self._c||t;return e("Common",{staticClass:"tags-wrapper",attrs:{sidebar:!1}},[e("ModuleTransition",[e("TagList",{directives:[{name:"show",rawName:"v-show",value:this.recoShowModule,expression:"recoShowModule"}],attrs:{currentTag:this.$recoLocales.all},on:{getCurrentTag:this.tagClick}})],1),this._v(" "),e("ModuleTransition",{attrs:{delay:"0.08"}},[e("note-abstract",{directives:[{name:"show",rawName:"v-show",value:this.recoShowModule,expression:"recoShowModule"}],staticClass:"list",attrs:{data:this.$recoPosts},on:{paginationChange:this.paginationChange}})],1)],1)}),[],!1,null,"615c9794",null);e.default=p.exports}}]); \ No newline at end of file diff --git a/assets/js/6.1f8ab323.js b/assets/js/6.1f8ab323.js new file mode 100644 index 0000000..4df865b --- /dev/null +++ b/assets/js/6.1f8ab323.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{425:function(t,e,a){},426:function(t,e,a){},427:function(t,e,a){},428:function(t,e,a){},429:function(t,e,a){"use strict";a(425)},430:function(t,e,a){},432:function(t,e,a){"use strict";a(68);var n=a(130),r=a(424),o=a(423),c=Object(n.b)({components:{RecoIcon:r.b},props:{pageInfo:{type:Object,default:function(){return{}}},currentTag:{type:String,default:""},showAccessNumber:{type:Boolean,default:!1}},setup:function(t,e){var a=Object(o.a)();return{numStyle:{fontSize:".9rem",fontWeight:"normal",color:"#999"},goTags:function(t){a.$route.path!=="/tag/".concat(t,"/")&&a.$router.push({path:"/tag/".concat(t,"/")})},formatDateValue:function(t){return new Intl.DateTimeFormat(a.$lang).format(new Date(t))}}}}),s=(a(433),a(9)),i=Object(s.a)(c,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.pageInfo.frontmatter.author||t.$themeConfig.author?a("reco-icon",{attrs:{icon:"reco-account"}},[a("span",[t._v(t._s(t.pageInfo.frontmatter.author||t.$themeConfig.author))])]):t._e(),t._v(" "),t.pageInfo.frontmatter.date?a("reco-icon",{attrs:{icon:"reco-date"}},[a("span",[t._v(t._s(t.formatDateValue(t.pageInfo.frontmatter.date)))])]):t._e(),t._v(" "),!0===t.showAccessNumber?a("reco-icon",{attrs:{icon:"reco-eye"}},[a("AccessNumber",{attrs:{idVal:t.pageInfo.path,numStyle:t.numStyle}})],1):t._e(),t._v(" "),t.pageInfo.frontmatter.tags?a("reco-icon",{staticClass:"tags",attrs:{icon:"reco-tag"}},t._l(t.pageInfo.frontmatter.tags,(function(e,n){return a("span",{key:n,staticClass:"tag-item",class:{active:t.currentTag==e},on:{click:function(a){return a.stopPropagation(),t.goTags(e)}}},[t._v(t._s(e))])})),0):t._e()],1)}),[],!1,null,"f875f3fc",null);e.a=i.exports},433:function(t,e,a){"use strict";a(426)},434:function(t,e,a){"use strict";a(427)},435:function(t,e,a){"use strict";a(428)},436:function(t,e,a){"use strict";a(32);var n=a(130),r=(a(226),{methods:{_getStoragePage:function(){var t=window.location.pathname,e=JSON.parse(sessionStorage.getItem("currentPage"));return null===e||t!==e.path?(sessionStorage.setItem("currentPage",JSON.stringify({page:1,path:""})),1):parseInt(e.page)},_setStoragePage:function(t){var e=window.location.pathname;sessionStorage.setItem("currentPage",JSON.stringify({page:t,path:e}))}}}),o=a(424),c=a(432),s=Object(n.b)({components:{PageInfo:c.a,RecoIcon:o.b},props:["item","currentPage","currentTag"]}),i=(a(434),a(9)),u=Object(i.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-item",on:{click:function(e){return t.$router.push(t.item.path)}}},[t.item.frontmatter.sticky?a("reco-icon",{attrs:{icon:"reco-sticky"}}):t._e(),t._v(" "),a("div",{staticClass:"title"},[t.item.frontmatter.keys?a("reco-icon",{attrs:{icon:"reco-lock"}}):t._e(),t._v(" "),a("router-link",{attrs:{to:t.item.path}},[t._v(t._s(t.item.title))])],1),t._v(" "),a("div",{staticClass:"abstract",domProps:{innerHTML:t._s(t.item.excerpt)}}),t._v(" "),a("PageInfo",{attrs:{pageInfo:t.item,currentTag:t.currentTag}})],1)}),[],!1,null,"ff2c8be0",null).exports,g=a(423),l=Object(n.b)({mixins:[r],components:{NoteAbstractItem:u},props:["data","currentTag"],setup:function(t,e){var a=Object(g.a)(),r=Object(n.h)(t).data,o=Object(n.g)(1),c=Object(n.a)((function(){var t=(o.value-1)*a.$perPage,e=o.value*a.$perPage;return r.value.slice(t,e)}));return Object(n.d)((function(){o.value=a._getStoragePage()||1})),{currentPage:o,currentPageData:c,getCurrentPage:function(t){o.value=t,a._setStoragePage(t),e.emit("paginationChange",t)}}},watch:{$route:function(){this.currentPage=this._getStoragePage()||1}}}),p=(a(435),Object(i.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"abstract-wrapper"},[t._l(t.currentPageData,(function(e){return a("NoteAbstractItem",{key:e.path,attrs:{item:e,currentPage:t.currentPage,currentTag:t.currentTag}})})),t._v(" "),a("pagation",{staticClass:"pagation",attrs:{total:t.data.length,currentPage:t.currentPage},on:{getCurrentPage:t.getCurrentPage}})],2)}),[],!1,null,"6cc0658a",null));e.a=p.exports},438:function(t,e,a){"use strict";a(430)},462:function(t,e,a){},504:function(t,e,a){"use strict";a(462)},548:function(t,e,a){"use strict";a.r(e);a(67);var n=a(130),r=a(440),o=a(436),c=a(424),s=a(64),i=a(93),u=a(437),g=a(423),l=Object(n.b)({mixins:[u.a],components:{Common:r.a,NoteAbstract:o.a,ModuleTransition:c.a},setup:function(t,e){var a=Object(g.a)();return{posts:Object(n.a)((function(){var t=a.$currentCategories.pages;return t=Object(s.a)(t),Object(s.c)(t),t})),title:Object(n.a)((function(){return a.$currentCategories.key})),getCurrentTag:function(t){e.emit("currentTag",t)},paginationChange:function(t){setTimeout((function(){window.scrollTo(0,0)}),100)},getOneColor:i.b}}}),p=(a(429),a(438),a(504),a(9)),f=Object(p.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("Common",{staticClass:"categories-wrapper",attrs:{sidebar:!1}},[a("ModuleTransition",[a("ul",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}],staticClass:"category-wrapper"},t._l(t.$categoriesList,(function(e,n){return a("li",{directives:[{name:"show",rawName:"v-show",value:e.pages.length>0,expression:"item.pages.length > 0"}],key:n,staticClass:"category-item",class:t.title==e.name?"active":""},[a("router-link",{attrs:{to:e.path}},[a("span",{staticClass:"category-name"},[t._v(t._s(e.name))]),t._v(" "),a("span",{staticClass:"post-num",style:{backgroundColor:t.getOneColor()}},[t._v(t._s(e.pages.length))])])],1)})),0)]),t._v(" "),a("ModuleTransition",{attrs:{delay:"0.08"}},[a("note-abstract",{directives:[{name:"show",rawName:"v-show",value:t.recoShowModule,expression:"recoShowModule"}],staticClass:"list",attrs:{data:t.posts},on:{paginationChange:t.paginationChange}})],1)],1)}),[],!1,null,"1e68bc8d",null);e.default=f.exports}}]); \ No newline at end of file diff --git a/assets/js/7.8f8c1b35.js b/assets/js/7.8f8c1b35.js new file mode 100644 index 0000000..a42b3c1 --- /dev/null +++ b/assets/js/7.8f8c1b35.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{423:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(72);function r(){var e=Object(o.d)();if(!e)throw new Error("must be called in setup");return e||{}}},425:function(e,t,n){},429:function(e,t,n){"use strict";n(425)},444:function(e,t,n){},478:function(e,t,n){"use strict";n(444)},547:function(e,t,n){"use strict";n.r(t);var o=n(130),r=n(423),c=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."],u=Object(o.b)({setup:function(e,t){var n=Object(r.a)(),u=Object(o.a)((function(){return!1!==n.$themeConfig.noFoundPageByTencent}));return Object(o.d)((function(){if(u.value){var e=document.createElement("script");e.setAttribute("homePageName","回到首页"),e.setAttribute("homePageUrl",n.$site.base),e.setAttribute("src","//qzonestyle.gtimg.cn/qzone/hybrid/app/404/search_children.js"),document.body.append(e)}})),{noFoundPageByTencent:u,getMsg:function(){return c[Math.floor(Math.random()*c.length)]}}}}),s=(n(429),n(478),n(9)),i=Object(s.a)(u,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.noFoundPageByTencent?e._e():n("section",{staticClass:"theme-container"},[n("article",{staticClass:"content"},[n("h1",[e._v("404")]),e._v(" "),n("blockquote",[e._v(e._s(e.getMsg()))]),e._v(" "),n("router-link",{attrs:{to:"/"}},[e._v("Take me home.")])],1)])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/8.799b7466.js b/assets/js/8.799b7466.js new file mode 100644 index 0000000..d4d4409 --- /dev/null +++ b/assets/js/8.799b7466.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{532:function(t,v,_){t.exports=_.p+"assets/img/url.1aa6edf7.png"},533:function(t,v,_){t.exports=_.p+"assets/img/dns-query.50e6d2a4.png"},534:function(t,v,_){t.exports=_.p+"assets/img/tcp.3243c763.png"},535:function(t,v,_){t.exports=_.p+"assets/img/http-request.e1203d0f.png"},536:function(t,v,_){t.exports=_.p+"assets/img/page-render.e17c9ae0.png"},570:function(t,v,_){"use strict";_.r(v);var e=_(9),a=Object(e.a)({},(function(){var t=this,v=t.$createElement,e=t._self._c||v;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h2",{attrs:{id:"一、简单分析"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#一、简单分析"}},[t._v("#")]),t._v(" 一、简单分析")]),t._v(" "),e("hr"),t._v(" "),e("p",[t._v("简单的分析,从输入 "),e("code",[t._v("URL")]),t._v("到回车后发生的行为如下:")]),t._v(" "),e("ul",[e("li",[t._v("URL 解析")]),t._v(" "),e("li",[t._v("DNS 查询")]),t._v(" "),e("li",[t._v("TCP 连接")]),t._v(" "),e("li",[t._v("HTTP 请求")]),t._v(" "),e("li",[t._v("响应请求")]),t._v(" "),e("li",[t._v("渲染页面")])]),t._v(" "),e("h2",{attrs:{id:"二、详细分析"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#二、详细分析"}},[t._v("#")]),t._v(" 二、详细分析")]),t._v(" "),e("hr"),t._v(" "),e("h3",{attrs:{id:"url-解析"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#url-解析"}},[t._v("#")]),t._v(" URL 解析")]),t._v(" "),e("p",[t._v("首先判断你输入的是一个合法的 "),e("code",[t._v("URL")]),t._v(" 还是一个待搜索的关键词,并且根据你输入的内容进行对应操作")]),t._v(" "),e("p",[e("code",[t._v("URL")]),t._v("的解析第过程中的第一步,一个"),e("code",[t._v("URL")]),t._v("的结构解析如下:")]),t._v(" "),e("p",[e("img",{attrs:{src:_(532),alt:"url结构解析",title:"url结构解析"}})]),t._v(" "),e("h3",{attrs:{id:"dns-查询"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#dns-查询"}},[t._v("#")]),t._v(" DNS 查询")]),t._v(" "),e("p",[t._v("在之前文章中讲过 DNS 的查询,这里就不再讲述了")]),t._v(" "),e("p",[t._v("整个查询过程如下图所示:")]),t._v(" "),e("p",[e("img",{attrs:{src:_(533),alt:"DNS的查询",title:"DNS的查询"}})]),t._v(" "),e("p",[t._v("最终,获取到了域名对应的目标服务器"),e("code",[t._v("IP")]),t._v("地址")]),t._v(" "),e("h3",{attrs:{id:"tcp-连接"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#tcp-连接"}},[t._v("#")]),t._v(" TCP 连接")]),t._v(" "),e("p",[t._v("在之前文章中,了解到"),e("code",[t._v("tcp")]),t._v("是一种面向有连接的传输层协议")]),t._v(" "),e("p",[t._v("在确定目标服务器服务器的"),e("code",[t._v("IP")]),t._v("地址后,则经历三次握手建立"),e("code",[t._v("TCP")]),t._v("连接,流程如下:")]),t._v(" "),e("p",[e("img",{attrs:{src:_(534),alt:"TCP的连接",title:"TCP的连接"}})]),t._v(" "),e("h3",{attrs:{id:"发送-http-请求"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#发送-http-请求"}},[t._v("#")]),t._v(" 发送 http 请求")]),t._v(" "),e("p",[t._v("当建立 tcp 连接之后,就可以在这基础上进行通信,浏览器发送 http 请求到目标服务器")]),t._v(" "),e("p",[t._v("请求的内容包括:")]),t._v(" "),e("ul",[e("li",[t._v("请求行")]),t._v(" "),e("li",[t._v("请求头")]),t._v(" "),e("li",[t._v("请求主体")])]),t._v(" "),e("p",[e("img",{attrs:{src:_(535),alt:"HTTP的请求",title:"HTTP的请求"}})]),t._v(" "),e("h3",{attrs:{id:"响应请求"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#响应请求"}},[t._v("#")]),t._v(" 响应请求")]),t._v(" "),e("p",[t._v("当服务器接收到浏览器的请求之后,就会进行逻辑操作,处理完成之后返回一个"),e("code",[t._v("HTTP")]),t._v("响应消息,包括:")]),t._v(" "),e("ul",[e("li",[t._v("状态行")]),t._v(" "),e("li",[t._v("响应头")]),t._v(" "),e("li",[t._v("响应正文")])]),t._v(" "),e("p",[t._v("在服务器响应之后,由于现在"),e("code",[t._v("http")]),t._v("默认开始长连接"),e("code",[t._v("keep-alive")]),t._v(",当页面关闭之后,"),e("code",[t._v("tcp")]),t._v("链接则会经过四次挥手完成断开")]),t._v(" "),e("h3",{attrs:{id:"页面渲染"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#页面渲染"}},[t._v("#")]),t._v(" 页面渲染")]),t._v(" "),e("p",[t._v("当浏览器接收到服务器响应的资源后,首先会对资源进行解析:")]),t._v(" "),e("ul",[e("li",[t._v("查看响应头的信息,根据不同的指示做对应处理,比如重定向,存储 cookie,解压 gzip,缓存资源等等")]),t._v(" "),e("li",[t._v("查看响应头的 Content-Type 的值,根据不同的资源类型采用不同的解析方式")])]),t._v(" "),e("p",[t._v("关于页面的渲染过程如下:")]),t._v(" "),e("ul",[e("li",[t._v("解析 HTML,构建 DOM 树")]),t._v(" "),e("li",[t._v("解析 CSS ,生成 CSS 规则树")]),t._v(" "),e("li",[t._v("合并 DOM 树和 CSS 规则,生成 render 树")]),t._v(" "),e("li",[t._v("布局 render 树( Layout / reflow ),负责各元素尺寸、位置的计算")]),t._v(" "),e("li",[t._v("绘制 render 树( paint ),绘制页面像素信息")]),t._v(" "),e("li",[t._v("浏览器会将各层的信息发送给 GPU,GPU 会将各层合成( composite ),显示在屏幕上")])]),t._v(" "),e("p",[e("img",{attrs:{src:_(536),alt:"页面渲染",title:"页面渲染"}})])])}),[],!1,null,null,null);v.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/9.a80a0694.js b/assets/js/9.a80a0694.js new file mode 100644 index 0000000..d2e43a5 --- /dev/null +++ b/assets/js/9.a80a0694.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{425:function(e,t,n){},429:function(e,t,n){"use strict";n(425)},473:function(e,t,n){},517:function(e,t,n){"use strict";n(473)},551:function(e,t,n){"use strict";n.r(t);n(228),n(229),n(68),n(38),n(48),n(230),n(131);var a=n(130),o=n(440),s=n(424),r=n(437),i=n(423),c=Object(a.b)({name:"TimeLine",mixins:[r.a],components:{Common:o.a,ModuleTransition:s.a},setup:function(e,t){var n=Object(i.a)();return{go:function(e){n.$router.push({path:e})},dateFormat:function(e,t){e=function(e){var t=new Date(e).toJSON();return new Date(+new Date(t)+288e5).toISOString().replace(/T/g," ").replace(/\.[\d]{3}Z/,"").replace(/-/g,"/")}(e);var n=new Date(e),a=n.getMonth()+1,o=n.getDate();return"".concat(a,"-").concat(o)}}}}),l=(n(429),n(517),n(9)),u=Object(l.a)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("Common",{staticClass:"timeline-wrapper",attrs:{sidebar:!1}},[n("ul",{staticClass:"timeline-content"},[n("ModuleTransition",[n("li",{directives:[{name:"show",rawName:"v-show",value:e.recoShowModule,expression:"recoShowModule"}],staticClass:"desc"},[e._v(e._s(e.$recoLocales.timeLineMsg))])]),e._v(" "),e._l(e.$recoPostsForTimeline,(function(t,a){return n("ModuleTransition",{key:a,attrs:{delay:String(.08*(a+1))}},[n("li",{directives:[{name:"show",rawName:"v-show",value:e.recoShowModule,expression:"recoShowModule"}]},[n("h3",{staticClass:"year"},[e._v(e._s(t.year))]),e._v(" "),n("ul",{staticClass:"year-wrapper"},e._l(t.data,(function(t,a){return n("li",{key:a},[n("span",{staticClass:"date"},[e._v(e._s(e.dateFormat(t.frontmatter.date)))]),e._v(" "),n("span",{staticClass:"title",on:{click:function(n){return e.go(t.path)}}},[e._v(e._s(t.title))])])})),0)])])}))],2)])}),[],!1,null,"42b59284",null);t.default=u.exports}}]); \ No newline at end of file diff --git a/assets/js/app.6011f3d7.js b/assets/js/app.6011f3d7.js new file mode 100644 index 0000000..e406ac8 --- /dev/null +++ b/assets/js/app.6011f3d7.js @@ -0,0 +1,58 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,s=e[0],u=e[1],c=e[2],f=0,p=[];f<s.length;f++)a=s[f],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(t[r]=u[r]);for(l&&l(e);p.length;)p.shift()();return i.push.apply(i,c||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],r=!0,s=1;s<n.length;s++){var u=n[s];0!==o[u]&&(r=!1)}r&&(i.splice(e--,1),t=a(a.s=n[0]))}return t}var r={},o={2:0},i=[];function a(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.e=function(t){var e=[],n=o[t];if(0!==n)if(n)e.push(n[2]);else{var r=new Promise((function(e,r){n=o[t]=[e,r]}));e.push(n[2]=r);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,a.nc&&s.setAttribute("nonce",a.nc),s.src=function(t){return a.p+"assets/js/"+({}[t]||t)+"."+{1:"8850014e",3:"f7e531a1",4:"4712295a",5:"aeeaf988",6:"1f8ab323",7:"8f8c1b35",8:"799b7466",9:"a80a0694",10:"5fc0fb3b",11:"27d5ec53",12:"b098df3c",13:"401f8270",14:"d04817e5",15:"e20c0fb6",16:"3b04dda9",17:"74a602dd",18:"5fa4ebb2",19:"0b569402",20:"c280ca61",21:"de804318",22:"d6e285b7",23:"52a57404",24:"5f6d1afa",25:"8523deab",26:"9bb01893",27:"26743516",28:"1951fccb",29:"5335ba69",30:"28a79af9",31:"43bc648e",32:"1170f994",33:"9a36924c",34:"2879f393",35:"83d3b502"}[t]+".js"}(t);var u=new Error;i=function(e){s.onerror=s.onload=null,clearTimeout(c);var n=o[t];if(0!==n){if(n){var r=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",u.name="ChunkLoadError",u.type=r,u.request=i,n[1](u)}o[t]=void 0}};var c=setTimeout((function(){i({type:"timeout",target:s})}),12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(e)},a.m=t,a.c=r,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="/blog/",a.oe=function(t){throw console.error(t),t};var s=window.webpackJsonp=window.webpackJsonp||[],u=s.push.bind(s);s.push=e,s=s.slice();for(var c=0;c<s.length;c++)e(s[c]);var l=u;i.push([235,0]),n()}([function(t,e,n){"use strict";n.r(e); +/*! + * Vue.js v2.6.12 + * (c) 2014-2020 Evan You + * Released under the MIT License. + */ +var r=Object.freeze({});function o(t){return null==t}function i(t){return null!=t}function a(t){return!0===t}function s(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function u(t){return null!==t&&"object"==typeof t}var c=Object.prototype.toString;function l(t){return"[object Object]"===c.call(t)}function f(t){return"[object RegExp]"===c.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return i(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||l(t)&&t.toString===c?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function m(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o<r.length;o++)n[r[o]]=!0;return e?function(t){return n[t.toLowerCase()]}:function(t){return n[t]}}m("slot,component",!0);var g=m("key,ref,slot,slot-scope,is");function y(t,e){if(t.length){var n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function w(t,e){return b.call(t,e)}function x(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var _=/-(\w)/g,E=x((function(t){return t.replace(_,(function(t,e){return e?e.toUpperCase():""}))})),A=x((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),k=/\B([A-Z])/g,C=x((function(t){return t.replace(k,"-$1").toLowerCase()}));var D=Function.prototype.bind?function(t,e){return t.bind(e)}:function(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n};function O(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function S(t,e){for(var n in e)t[n]=e[n];return t}function $(t){for(var e={},n=0;n<t.length;n++)t[n]&&S(e,t[n]);return e}function j(t,e,n){}var T=function(t,e,n){return!1},P=function(t){return t};function B(t,e){if(t===e)return!0;var n=u(t),r=u(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=Array.isArray(t),i=Array.isArray(e);if(o&&i)return t.length===e.length&&t.every((function(t,n){return B(t,e[n])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||i)return!1;var a=Object.keys(t),s=Object.keys(e);return a.length===s.length&&a.every((function(n){return B(t[n],e[n])}))}catch(t){return!1}}function F(t,e){for(var n=0;n<t.length;n++)if(B(t[n],e))return n;return-1}function I(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}var M=["component","directive","filter"],R=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],L={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:j,parsePlatformTagName:P,mustUseProp:T,async:!0,_lifecycleHooks:R},z=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function N(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var U=new RegExp("[^"+z.source+".$_\\d]");var V,H="__proto__"in{},q="undefined"!=typeof window,W="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,J=W&&WXEnvironment.platform.toLowerCase(),G=q&&window.navigator.userAgent.toLowerCase(),Q=G&&/msie|trident/.test(G),Y=G&&G.indexOf("msie 9.0")>0,K=G&&G.indexOf("edge/")>0,Z=(G&&G.indexOf("android"),G&&/iphone|ipad|ipod|ios/.test(G)||"ios"===J),X=(G&&/chrome\/\d+/.test(G),G&&/phantomjs/.test(G),G&&G.match(/firefox\/(\d+)/)),tt={}.watch,et=!1;if(q)try{var nt={};Object.defineProperty(nt,"passive",{get:function(){et=!0}}),window.addEventListener("test-passive",null,nt)}catch(t){}var rt=function(){return void 0===V&&(V=!q&&!W&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),V},ot=q&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function it(t){return"function"==typeof t&&/native code/.test(t.toString())}var at,st="undefined"!=typeof Symbol&&it(Symbol)&&"undefined"!=typeof Reflect&&it(Reflect.ownKeys);at="undefined"!=typeof Set&&it(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var ut=j,ct=0,lt=function(){this.id=ct++,this.subs=[]};lt.prototype.addSub=function(t){this.subs.push(t)},lt.prototype.removeSub=function(t){y(this.subs,t)},lt.prototype.depend=function(){lt.target&<.target.addDep(this)},lt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e<n;e++)t[e].update()},lt.target=null;var ft=[];function pt(t){ft.push(t),lt.target=t}function dt(){ft.pop(),lt.target=ft[ft.length-1]}var ht=function(t,e,n,r,o,i,a,s){this.tag=t,this.data=e,this.children=n,this.text=r,this.elm=o,this.ns=void 0,this.context=i,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},vt={child:{configurable:!0}};vt.child.get=function(){return this.componentInstance},Object.defineProperties(ht.prototype,vt);var mt=function(t){void 0===t&&(t="");var e=new ht;return e.text=t,e.isComment=!0,e};function gt(t){return new ht(void 0,void 0,void 0,String(t))}function yt(t){var e=new ht(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var bt=Array.prototype,wt=Object.create(bt);["push","pop","shift","unshift","splice","sort","reverse"].forEach((function(t){var e=bt[t];N(wt,t,(function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var o,i=e.apply(this,n),a=this.__ob__;switch(t){case"push":case"unshift":o=n;break;case"splice":o=n.slice(2)}return o&&a.observeArray(o),a.dep.notify(),i}))}));var xt=Object.getOwnPropertyNames(wt),_t=!0;function Et(t){_t=t}var At=function(t){this.value=t,this.dep=new lt,this.vmCount=0,N(t,"__ob__",this),Array.isArray(t)?(H?function(t,e){t.__proto__=e}(t,wt):function(t,e,n){for(var r=0,o=n.length;r<o;r++){var i=n[r];N(t,i,e[i])}}(t,wt,xt),this.observeArray(t)):this.walk(t)};function kt(t,e){var n;if(u(t)&&!(t instanceof ht))return w(t,"__ob__")&&t.__ob__ instanceof At?n=t.__ob__:_t&&!rt()&&(Array.isArray(t)||l(t))&&Object.isExtensible(t)&&!t._isVue&&(n=new At(t)),e&&n&&n.vmCount++,n}function Ct(t,e,n,r,o){var i=new lt,a=Object.getOwnPropertyDescriptor(t,e);if(!a||!1!==a.configurable){var s=a&&a.get,u=a&&a.set;s&&!u||2!==arguments.length||(n=t[e]);var c=!o&&kt(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=s?s.call(t):n;return lt.target&&(i.depend(),c&&(c.dep.depend(),Array.isArray(e)&&St(e))),e},set:function(e){var r=s?s.call(t):n;e===r||e!=e&&r!=r||s&&!u||(u?u.call(t,e):n=e,c=!o&&kt(e),i.notify())}})}}function Dt(t,e,n){if(Array.isArray(t)&&p(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),n;if(e in t&&!(e in Object.prototype))return t[e]=n,n;var r=t.__ob__;return t._isVue||r&&r.vmCount?n:r?(Ct(r.value,e,n),r.dep.notify(),n):(t[e]=n,n)}function Ot(t,e){if(Array.isArray(t)&&p(e))t.splice(e,1);else{var n=t.__ob__;t._isVue||n&&n.vmCount||w(t,e)&&(delete t[e],n&&n.dep.notify())}}function St(t){for(var e=void 0,n=0,r=t.length;n<r;n++)(e=t[n])&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&St(e)}At.prototype.walk=function(t){for(var e=Object.keys(t),n=0;n<e.length;n++)Ct(t,e[n])},At.prototype.observeArray=function(t){for(var e=0,n=t.length;e<n;e++)kt(t[e])};var $t=L.optionMergeStrategies;function jt(t,e){if(!e)return t;for(var n,r,o,i=st?Reflect.ownKeys(e):Object.keys(e),a=0;a<i.length;a++)"__ob__"!==(n=i[a])&&(r=t[n],o=e[n],w(t,n)?r!==o&&l(r)&&l(o)&&jt(r,o):Dt(t,n,o));return t}function Tt(t,e,n){return n?function(){var r="function"==typeof e?e.call(n,n):e,o="function"==typeof t?t.call(n,n):t;return r?jt(r,o):o}:e?t?function(){return jt("function"==typeof e?e.call(this,this):e,"function"==typeof t?t.call(this,this):t)}:e:t}function Pt(t,e){var n=e?t?t.concat(e):Array.isArray(e)?e:[e]:t;return n?function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}(n):n}function Bt(t,e,n,r){var o=Object.create(t||null);return e?S(o,e):o}$t.data=function(t,e,n){return n?Tt(t,e,n):e&&"function"!=typeof e?t:Tt(t,e)},R.forEach((function(t){$t[t]=Pt})),M.forEach((function(t){$t[t+"s"]=Bt})),$t.watch=function(t,e,n,r){if(t===tt&&(t=void 0),e===tt&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var o={};for(var i in S(o,t),e){var a=o[i],s=e[i];a&&!Array.isArray(a)&&(a=[a]),o[i]=a?a.concat(s):Array.isArray(s)?s:[s]}return o},$t.props=$t.methods=$t.inject=$t.computed=function(t,e,n,r){if(!t)return e;var o=Object.create(null);return S(o,t),e&&S(o,e),o},$t.provide=Tt;var Ft=function(t,e){return void 0===e?t:e};function It(t,e,n){if("function"==typeof e&&(e=e.options),function(t,e){var n=t.props;if(n){var r,o,i={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(o=n[r])&&(i[E(o)]={type:null});else if(l(n))for(var a in n)o=n[a],i[E(a)]=l(o)?o:{type:o};else 0;t.props=i}}(e),function(t,e){var n=t.inject;if(n){var r=t.inject={};if(Array.isArray(n))for(var o=0;o<n.length;o++)r[n[o]]={from:n[o]};else if(l(n))for(var i in n){var a=n[i];r[i]=l(a)?S({from:i},a):{from:a}}else 0}}(e),function(t){var e=t.directives;if(e)for(var n in e){var r=e[n];"function"==typeof r&&(e[n]={bind:r,update:r})}}(e),!e._base&&(e.extends&&(t=It(t,e.extends,n)),e.mixins))for(var r=0,o=e.mixins.length;r<o;r++)t=It(t,e.mixins[r],n);var i,a={};for(i in t)s(i);for(i in e)w(t,i)||s(i);function s(r){var o=$t[r]||Ft;a[r]=o(t[r],e[r],n,r)}return a}function Mt(t,e,n,r){if("string"==typeof n){var o=t[e];if(w(o,n))return o[n];var i=E(n);if(w(o,i))return o[i];var a=A(i);return w(o,a)?o[a]:o[n]||o[i]||o[a]}}function Rt(t,e,n,r){var o=e[t],i=!w(n,t),a=n[t],s=Nt(Boolean,o.type);if(s>-1)if(i&&!w(o,"default"))a=!1;else if(""===a||a===C(t)){var u=Nt(String,o.type);(u<0||s<u)&&(a=!0)}if(void 0===a){a=function(t,e,n){if(!w(e,"default"))return;var r=e.default;0;if(t&&t.$options.propsData&&void 0===t.$options.propsData[n]&&void 0!==t._props[n])return t._props[n];return"function"==typeof r&&"Function"!==Lt(e.type)?r.call(t):r}(r,o,t);var c=_t;Et(!0),kt(a),Et(c)}return a}function Lt(t){var e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function zt(t,e){return Lt(t)===Lt(e)}function Nt(t,e){if(!Array.isArray(e))return zt(e,t)?0:-1;for(var n=0,r=e.length;n<r;n++)if(zt(e[n],t))return n;return-1}function Ut(t,e,n){pt();try{if(e)for(var r=e;r=r.$parent;){var o=r.$options.errorCaptured;if(o)for(var i=0;i<o.length;i++)try{if(!1===o[i].call(r,t,e,n))return}catch(t){Ht(t,r,"errorCaptured hook")}}Ht(t,e,n)}finally{dt()}}function Vt(t,e,n,r,o){var i;try{(i=n?t.apply(e,n):t.call(e))&&!i._isVue&&d(i)&&!i._handled&&(i.catch((function(t){return Ut(t,r,o+" (Promise/async)")})),i._handled=!0)}catch(t){Ut(t,r,o)}return i}function Ht(t,e,n){if(L.errorHandler)try{return L.errorHandler.call(null,t,e,n)}catch(e){e!==t&&qt(e,null,"config.errorHandler")}qt(t,e,n)}function qt(t,e,n){if(!q&&!W||"undefined"==typeof console)throw t;console.error(t)}var Wt,Jt=!1,Gt=[],Qt=!1;function Yt(){Qt=!1;var t=Gt.slice(0);Gt.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!=typeof Promise&&it(Promise)){var Kt=Promise.resolve();Wt=function(){Kt.then(Yt),Z&&setTimeout(j)},Jt=!0}else if(Q||"undefined"==typeof MutationObserver||!it(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())Wt="undefined"!=typeof setImmediate&&it(setImmediate)?function(){setImmediate(Yt)}:function(){setTimeout(Yt,0)};else{var Zt=1,Xt=new MutationObserver(Yt),te=document.createTextNode(String(Zt));Xt.observe(te,{characterData:!0}),Wt=function(){Zt=(Zt+1)%2,te.data=String(Zt)},Jt=!0}function ee(t,e){var n;if(Gt.push((function(){if(t)try{t.call(e)}catch(t){Ut(t,e,"nextTick")}else n&&n(e)})),Qt||(Qt=!0,Wt()),!t&&"undefined"!=typeof Promise)return new Promise((function(t){n=t}))}var ne=new at;function re(t){!function t(e,n){var r,o,i=Array.isArray(e);if(!i&&!u(e)||Object.isFrozen(e)||e instanceof ht)return;if(e.__ob__){var a=e.__ob__.dep.id;if(n.has(a))return;n.add(a)}if(i)for(r=e.length;r--;)t(e[r],n);else for(o=Object.keys(e),r=o.length;r--;)t(e[o[r]],n)}(t,ne),ne.clear()}var oe=x((function(t){var e="&"===t.charAt(0),n="~"===(t=e?t.slice(1):t).charAt(0),r="!"===(t=n?t.slice(1):t).charAt(0);return{name:t=r?t.slice(1):t,once:n,capture:r,passive:e}}));function ie(t,e){function n(){var t=arguments,r=n.fns;if(!Array.isArray(r))return Vt(r,null,arguments,e,"v-on handler");for(var o=r.slice(),i=0;i<o.length;i++)Vt(o[i],null,t,e,"v-on handler")}return n.fns=t,n}function ae(t,e,n,r,i,s){var u,c,l,f;for(u in t)c=t[u],l=e[u],f=oe(u),o(c)||(o(l)?(o(c.fns)&&(c=t[u]=ie(c,s)),a(f.once)&&(c=t[u]=i(f.name,c,f.capture)),n(f.name,c,f.capture,f.passive,f.params)):c!==l&&(l.fns=c,t[u]=l));for(u in e)o(t[u])&&r((f=oe(u)).name,e[u],f.capture)}function se(t,e,n){var r;t instanceof ht&&(t=t.data.hook||(t.data.hook={}));var s=t[e];function u(){n.apply(this,arguments),y(r.fns,u)}o(s)?r=ie([u]):i(s.fns)&&a(s.merged)?(r=s).fns.push(u):r=ie([s,u]),r.merged=!0,t[e]=r}function ue(t,e,n,r,o){if(i(e)){if(w(e,n))return t[n]=e[n],o||delete e[n],!0;if(w(e,r))return t[n]=e[r],o||delete e[r],!0}return!1}function ce(t){return s(t)?[gt(t)]:Array.isArray(t)?function t(e,n){var r,u,c,l,f=[];for(r=0;r<e.length;r++)o(u=e[r])||"boolean"==typeof u||(c=f.length-1,l=f[c],Array.isArray(u)?u.length>0&&(le((u=t(u,(n||"")+"_"+r))[0])&&le(l)&&(f[c]=gt(l.text+u[0].text),u.shift()),f.push.apply(f,u)):s(u)?le(l)?f[c]=gt(l.text+u):""!==u&&f.push(gt(u)):le(u)&&le(l)?f[c]=gt(l.text+u.text):(a(e._isVList)&&i(u.tag)&&o(u.key)&&i(n)&&(u.key="__vlist"+n+"_"+r+"__"),f.push(u)));return f}(t):void 0}function le(t){return i(t)&&i(t.text)&&!1===t.isComment}function fe(t,e){if(t){for(var n=Object.create(null),r=st?Reflect.ownKeys(t):Object.keys(t),o=0;o<r.length;o++){var i=r[o];if("__ob__"!==i){for(var a=t[i].from,s=e;s;){if(s._provided&&w(s._provided,a)){n[i]=s._provided[a];break}s=s.$parent}if(!s)if("default"in t[i]){var u=t[i].default;n[i]="function"==typeof u?u.call(e):u}else 0}}return n}}function pe(t,e){if(!t||!t.length)return{};for(var n={},r=0,o=t.length;r<o;r++){var i=t[r],a=i.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,i.context!==e&&i.fnContext!==e||!a||null==a.slot)(n.default||(n.default=[])).push(i);else{var s=a.slot,u=n[s]||(n[s]=[]);"template"===i.tag?u.push.apply(u,i.children||[]):u.push(i)}}for(var c in n)n[c].every(de)&&delete n[c];return n}function de(t){return t.isComment&&!t.asyncFactory||" "===t.text}function he(t,e,n){var o,i=Object.keys(e).length>0,a=t?!!t.$stable:!i,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&n&&n!==r&&s===n.$key&&!i&&!n.$hasNormal)return n;for(var u in o={},t)t[u]&&"$"!==u[0]&&(o[u]=ve(e,u,t[u]))}else o={};for(var c in e)c in o||(o[c]=me(e,c));return t&&Object.isExtensible(t)&&(t._normalized=o),N(o,"$stable",a),N(o,"$key",s),N(o,"$hasNormal",i),o}function ve(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return(t=t&&"object"==typeof t&&!Array.isArray(t)?[t]:ce(t))&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function me(t,e){return function(){return t[e]}}function ge(t,e){var n,r,o,a,s;if(Array.isArray(t)||"string"==typeof t)for(n=new Array(t.length),r=0,o=t.length;r<o;r++)n[r]=e(t[r],r);else if("number"==typeof t)for(n=new Array(t),r=0;r<t;r++)n[r]=e(r+1,r);else if(u(t))if(st&&t[Symbol.iterator]){n=[];for(var c=t[Symbol.iterator](),l=c.next();!l.done;)n.push(e(l.value,n.length)),l=c.next()}else for(a=Object.keys(t),n=new Array(a.length),r=0,o=a.length;r<o;r++)s=a[r],n[r]=e(t[s],s,r);return i(n)||(n=[]),n._isVList=!0,n}function ye(t,e,n,r){var o,i=this.$scopedSlots[t];i?(n=n||{},r&&(n=S(S({},r),n)),o=i(n)||e):o=this.$slots[t]||e;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},o):o}function be(t){return Mt(this.$options,"filters",t)||P}function we(t,e){return Array.isArray(t)?-1===t.indexOf(e):t!==e}function xe(t,e,n,r,o){var i=L.keyCodes[e]||n;return o&&r&&!L.keyCodes[e]?we(o,r):i?we(i,t):r?C(r)!==e:void 0}function _e(t,e,n,r,o){if(n)if(u(n)){var i;Array.isArray(n)&&(n=$(n));var a=function(a){if("class"===a||"style"===a||g(a))i=t;else{var s=t.attrs&&t.attrs.type;i=r||L.mustUseProp(e,s,a)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var u=E(a),c=C(a);u in i||c in i||(i[a]=n[a],o&&((t.on||(t.on={}))["update:"+a]=function(t){n[a]=t}))};for(var s in n)a(s)}else;return t}function Ee(t,e){var n=this._staticTrees||(this._staticTrees=[]),r=n[t];return r&&!e||ke(r=n[t]=this.$options.staticRenderFns[t].call(this._renderProxy,null,this),"__static__"+t,!1),r}function Ae(t,e,n){return ke(t,"__once__"+e+(n?"_"+n:""),!0),t}function ke(t,e,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)t[r]&&"string"!=typeof t[r]&&Ce(t[r],e+"_"+r,n);else Ce(t,e,n)}function Ce(t,e,n){t.isStatic=!0,t.key=e,t.isOnce=n}function De(t,e){if(e)if(l(e)){var n=t.on=t.on?S({},t.on):{};for(var r in e){var o=n[r],i=e[r];n[r]=o?[].concat(o,i):i}}else;return t}function Oe(t,e,n,r){e=e||{$stable:!n};for(var o=0;o<t.length;o++){var i=t[o];Array.isArray(i)?Oe(i,e,n):i&&(i.proxy&&(i.fn.proxy=!0),e[i.key]=i.fn)}return r&&(e.$key=r),e}function Se(t,e){for(var n=0;n<e.length;n+=2){var r=e[n];"string"==typeof r&&r&&(t[e[n]]=e[n+1])}return t}function $e(t,e){return"string"==typeof t?e+t:t}function je(t){t._o=Ae,t._n=v,t._s=h,t._l=ge,t._t=ye,t._q=B,t._i=F,t._m=Ee,t._f=be,t._k=xe,t._b=_e,t._v=gt,t._e=mt,t._u=Oe,t._g=De,t._d=Se,t._p=$e}function Te(t,e,n,o,i){var s,u=this,c=i.options;w(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=a(c._compiled),f=!l;this.data=t,this.props=e,this.children=n,this.parent=o,this.listeners=t.on||r,this.injections=fe(c.inject,o),this.slots=function(){return u.$slots||he(t.scopedSlots,u.$slots=pe(n,o)),u.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return he(t.scopedSlots,this.slots())}}),l&&(this.$options=c,this.$slots=this.slots(),this.$scopedSlots=he(t.scopedSlots,this.$slots)),c._scopeId?this._c=function(t,e,n,r){var i=Le(s,t,e,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=c._scopeId,i.fnContext=o),i}:this._c=function(t,e,n,r){return Le(s,t,e,n,r,f)}}function Pe(t,e,n,r,o){var i=yt(t);return i.fnContext=n,i.fnOptions=r,e.slot&&((i.data||(i.data={})).slot=e.slot),i}function Be(t,e){for(var n in e)t[E(n)]=e[n]}je(Te.prototype);var Fe={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var n=t;Fe.prepatch(n,n)}else{(t.componentInstance=function(t,e){var n={_isComponent:!0,_parentVnode:t,parent:e},r=t.data.inlineTemplate;i(r)&&(n.render=r.render,n.staticRenderFns=r.staticRenderFns);return new t.componentOptions.Ctor(n)}(t,Qe)).$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var n=e.componentOptions;!function(t,e,n,o,i){0;var a=o.data.scopedSlots,s=t.$scopedSlots,u=!!(a&&!a.$stable||s!==r&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),c=!!(i||t.$options._renderChildren||u);t.$options._parentVnode=o,t.$vnode=o,t._vnode&&(t._vnode.parent=o);if(t.$options._renderChildren=i,t.$attrs=o.data.attrs||r,t.$listeners=n||r,e&&t.$options.props){Et(!1);for(var l=t._props,f=t.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],h=t.$options.props;l[d]=Rt(d,h,e,t)}Et(!0),t.$options.propsData=e}n=n||r;var v=t.$options._parentListeners;t.$options._parentListeners=n,Ge(t,n,v),c&&(t.$slots=pe(i,o.context),t.$forceUpdate());0}(e.componentInstance=t.componentInstance,n.propsData,n.listeners,e,n.children)},insert:function(t){var e,n=t.context,r=t.componentInstance;r._isMounted||(r._isMounted=!0,Xe(r,"mounted")),t.data.keepAlive&&(n._isMounted?((e=r)._inactive=!1,en.push(e)):Ze(r,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?function t(e,n){if(n&&(e._directInactive=!0,Ke(e)))return;if(!e._inactive){e._inactive=!0;for(var r=0;r<e.$children.length;r++)t(e.$children[r]);Xe(e,"deactivated")}}(e,!0):e.$destroy())}},Ie=Object.keys(Fe);function Me(t,e,n,s,c){if(!o(t)){var l=n.$options._base;if(u(t)&&(t=l.extend(t)),"function"==typeof t){var f;if(o(t.cid)&&void 0===(t=function(t,e){if(a(t.error)&&i(t.errorComp))return t.errorComp;if(i(t.resolved))return t.resolved;var n=Ne;n&&i(t.owners)&&-1===t.owners.indexOf(n)&&t.owners.push(n);if(a(t.loading)&&i(t.loadingComp))return t.loadingComp;if(n&&!i(t.owners)){var r=t.owners=[n],s=!0,c=null,l=null;n.$on("hook:destroyed",(function(){return y(r,n)}));var f=function(t){for(var e=0,n=r.length;e<n;e++)r[e].$forceUpdate();t&&(r.length=0,null!==c&&(clearTimeout(c),c=null),null!==l&&(clearTimeout(l),l=null))},p=I((function(n){t.resolved=Ue(n,e),s?r.length=0:f(!0)})),h=I((function(e){i(t.errorComp)&&(t.error=!0,f(!0))})),v=t(p,h);return u(v)&&(d(v)?o(t.resolved)&&v.then(p,h):d(v.component)&&(v.component.then(p,h),i(v.error)&&(t.errorComp=Ue(v.error,e)),i(v.loading)&&(t.loadingComp=Ue(v.loading,e),0===v.delay?t.loading=!0:c=setTimeout((function(){c=null,o(t.resolved)&&o(t.error)&&(t.loading=!0,f(!1))}),v.delay||200)),i(v.timeout)&&(l=setTimeout((function(){l=null,o(t.resolved)&&h(null)}),v.timeout)))),s=!1,t.loading?t.loadingComp:t.resolved}}(f=t,l)))return function(t,e,n,r,o){var i=mt();return i.asyncFactory=t,i.asyncMeta={data:e,context:n,children:r,tag:o},i}(f,e,n,s,c);e=e||{},_n(t),i(e.model)&&function(t,e){var n=t.model&&t.model.prop||"value",r=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[n]=e.model.value;var o=e.on||(e.on={}),a=o[r],s=e.model.callback;i(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[r]=[s].concat(a)):o[r]=s}(t.options,e);var p=function(t,e,n){var r=e.options.props;if(!o(r)){var a={},s=t.attrs,u=t.props;if(i(s)||i(u))for(var c in r){var l=C(c);ue(a,u,c,l,!0)||ue(a,s,c,l,!1)}return a}}(e,t);if(a(t.options.functional))return function(t,e,n,o,a){var s=t.options,u={},c=s.props;if(i(c))for(var l in c)u[l]=Rt(l,c,e||r);else i(n.attrs)&&Be(u,n.attrs),i(n.props)&&Be(u,n.props);var f=new Te(n,u,a,o,t),p=s.render.call(null,f._c,f);if(p instanceof ht)return Pe(p,n,f.parent,s,f);if(Array.isArray(p)){for(var d=ce(p)||[],h=new Array(d.length),v=0;v<d.length;v++)h[v]=Pe(d[v],n,f.parent,s,f);return h}}(t,p,e,n,s);var h=e.on;if(e.on=e.nativeOn,a(t.options.abstract)){var v=e.slot;e={},v&&(e.slot=v)}!function(t){for(var e=t.hook||(t.hook={}),n=0;n<Ie.length;n++){var r=Ie[n],o=e[r],i=Fe[r];o===i||o&&o._merged||(e[r]=o?Re(i,o):i)}}(e);var m=t.options.name||c;return new ht("vue-component-"+t.cid+(m?"-"+m:""),e,void 0,void 0,void 0,n,{Ctor:t,propsData:p,listeners:h,tag:c,children:s},f)}}}function Re(t,e){var n=function(n,r){t(n,r),e(n,r)};return n._merged=!0,n}function Le(t,e,n,r,c,l){return(Array.isArray(n)||s(n))&&(c=r,r=n,n=void 0),a(l)&&(c=2),function(t,e,n,r,s){if(i(n)&&i(n.__ob__))return mt();i(n)&&i(n.is)&&(e=n.is);if(!e)return mt();0;Array.isArray(r)&&"function"==typeof r[0]&&((n=n||{}).scopedSlots={default:r[0]},r.length=0);2===s?r=ce(r):1===s&&(r=function(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}(r));var c,l;if("string"==typeof e){var f;l=t.$vnode&&t.$vnode.ns||L.getTagNamespace(e),c=L.isReservedTag(e)?new ht(L.parsePlatformTagName(e),n,r,void 0,void 0,t):n&&n.pre||!i(f=Mt(t.$options,"components",e))?new ht(e,n,r,void 0,void 0,t):Me(f,n,t,r,e)}else c=Me(e,n,t,r);return Array.isArray(c)?c:i(c)?(i(l)&&function t(e,n,r){e.ns=n,"foreignObject"===e.tag&&(n=void 0,r=!0);if(i(e.children))for(var s=0,u=e.children.length;s<u;s++){var c=e.children[s];i(c.tag)&&(o(c.ns)||a(r)&&"svg"!==c.tag)&&t(c,n,r)}}(c,l),i(n)&&function(t){u(t.style)&&re(t.style);u(t.class)&&re(t.class)}(n),c):mt()}(t,e,n,r,c)}var ze,Ne=null;function Ue(t,e){return(t.__esModule||st&&"Module"===t[Symbol.toStringTag])&&(t=t.default),u(t)?e.extend(t):t}function Ve(t){return t.isComment&&t.asyncFactory}function He(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var n=t[e];if(i(n)&&(i(n.componentOptions)||Ve(n)))return n}}function qe(t,e){ze.$on(t,e)}function We(t,e){ze.$off(t,e)}function Je(t,e){var n=ze;return function r(){var o=e.apply(null,arguments);null!==o&&n.$off(t,r)}}function Ge(t,e,n){ze=t,ae(e,n||{},qe,We,Je,t),ze=void 0}var Qe=null;function Ye(t){var e=Qe;return Qe=t,function(){Qe=e}}function Ke(t){for(;t&&(t=t.$parent);)if(t._inactive)return!0;return!1}function Ze(t,e){if(e){if(t._directInactive=!1,Ke(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var n=0;n<t.$children.length;n++)Ze(t.$children[n]);Xe(t,"activated")}}function Xe(t,e){pt();var n=t.$options[e],r=e+" hook";if(n)for(var o=0,i=n.length;o<i;o++)Vt(n[o],t,null,t,r);t._hasHookEvent&&t.$emit("hook:"+e),dt()}var tn=[],en=[],nn={},rn=!1,on=!1,an=0;var sn=0,un=Date.now;if(q&&!Q){var cn=window.performance;cn&&"function"==typeof cn.now&&un()>document.createEvent("Event").timeStamp&&(un=function(){return cn.now()})}function ln(){var t,e;for(sn=un(),on=!0,tn.sort((function(t,e){return t.id-e.id})),an=0;an<tn.length;an++)(t=tn[an]).before&&t.before(),e=t.id,nn[e]=null,t.run();var n=en.slice(),r=tn.slice();an=tn.length=en.length=0,nn={},rn=on=!1,function(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Ze(t[e],!0)}(n),function(t){var e=t.length;for(;e--;){var n=t[e],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Xe(r,"updated")}}(r),ot&&L.devtools&&ot.emit("flush")}var fn=0,pn=function(t,e,n,r,o){this.vm=t,o&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++fn,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new at,this.newDepIds=new at,this.expression="","function"==typeof e?this.getter=e:(this.getter=function(t){if(!U.test(t)){var e=t.split(".");return function(t){for(var n=0;n<e.length;n++){if(!t)return;t=t[e[n]]}return t}}}(e),this.getter||(this.getter=j)),this.value=this.lazy?void 0:this.get()};pn.prototype.get=function(){var t;pt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(t){if(!this.user)throw t;Ut(t,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&re(t),dt(),this.cleanupDeps()}return t},pn.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},pn.prototype.cleanupDeps=function(){for(var t=this.deps.length;t--;){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},pn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(t){var e=t.id;if(null==nn[e]){if(nn[e]=!0,on){for(var n=tn.length-1;n>an&&tn[n].id>t.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);rn||(rn=!0,ee(ln))}}(this)},pn.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||u(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){Ut(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},pn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},pn.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},pn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:j,set:j};function hn(t,e,n){dn.get=function(){return this[e][n]},dn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,dn)}function vn(t){t._watchers=[];var e=t.$options;e.props&&function(t,e){var n=t.$options.propsData||{},r=t._props={},o=t.$options._propKeys=[];t.$parent&&Et(!1);var i=function(i){o.push(i);var a=Rt(i,e,n,t);Ct(r,i,a),i in t||hn(t,"_props",i)};for(var a in e)i(a);Et(!0)}(t,e.props),e.methods&&function(t,e){t.$options.props;for(var n in e)t[n]="function"!=typeof e[n]?j:D(e[n],t)}(t,e.methods),e.data?function(t){var e=t.$options.data;l(e=t._data="function"==typeof e?function(t,e){pt();try{return t.call(e,e)}catch(t){return Ut(t,e,"data()"),{}}finally{dt()}}(e,t):e||{})||(e={});var n=Object.keys(e),r=t.$options.props,o=(t.$options.methods,n.length);for(;o--;){var i=n[o];0,r&&w(r,i)||(a=void 0,36!==(a=(i+"").charCodeAt(0))&&95!==a&&hn(t,"_data",i))}var a;kt(e,!0)}(t):kt(t._data={},!0),e.computed&&function(t,e){var n=t._computedWatchers=Object.create(null),r=rt();for(var o in e){var i=e[o],a="function"==typeof i?i:i.get;0,r||(n[o]=new pn(t,a||j,j,mn)),o in t||gn(t,o,i)}}(t,e.computed),e.watch&&e.watch!==tt&&function(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var o=0;o<r.length;o++)wn(t,n,r[o]);else wn(t,n,r)}}(t,e.watch)}var mn={lazy:!0};function gn(t,e,n){var r=!rt();"function"==typeof n?(dn.get=r?yn(e):bn(n),dn.set=j):(dn.get=n.get?r&&!1!==n.cache?yn(e):bn(n.get):j,dn.set=n.set||j),Object.defineProperty(t,e,dn)}function yn(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),lt.target&&e.depend(),e.value}}function bn(t){return function(){return t.call(this,this)}}function wn(t,e,n,r){return l(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var xn=0;function _n(t){var e=t.options;if(t.super){var n=_n(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var o in n)n[o]!==r[o]&&(e||(e={}),e[o]=n[o]);return e}(t);r&&S(t.extendOptions,r),(e=t.options=It(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function En(t){this._init(t)}function An(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=t.name||n.options.name;var a=function(t){this._init(t)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=e++,a.options=It(n.options,t),a.super=n,a.options.props&&function(t){var e=t.options.props;for(var n in e)hn(t.prototype,"_props",n)}(a),a.options.computed&&function(t){var e=t.options.computed;for(var n in e)gn(t.prototype,n,e[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,M.forEach((function(t){a[t]=n[t]})),i&&(a.options.components[i]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=S({},a.options),o[r]=a,a}}function kn(t){return t&&(t.Ctor.options.name||t.tag)}function Cn(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"==typeof t?t.split(",").indexOf(e)>-1:!!f(t)&&t.test(e)}function Dn(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var a=n[i];if(a){var s=kn(a.componentOptions);s&&!e(s)&&On(n,i,r,o)}}}function On(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,y(n,e)}!function(t){t.prototype._init=function(t){var e=this;e._uid=xn++,e._isVue=!0,t&&t._isComponent?function(t,e){var n=t.$options=Object.create(t.constructor.options),r=e._parentVnode;n.parent=e.parent,n._parentVnode=r;var o=r.componentOptions;n.propsData=o.propsData,n._parentListeners=o.listeners,n._renderChildren=o.children,n._componentTag=o.tag,e.render&&(n.render=e.render,n.staticRenderFns=e.staticRenderFns)}(e,t):e.$options=It(_n(e.constructor),t||{},e),e._renderProxy=e,e._self=e,function(t){var e=t.$options,n=e.parent;if(n&&!e.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(t)}t.$parent=n,t.$root=n?n.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}(e),function(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ge(t,e)}(e),function(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=pe(e._renderChildren,o),t.$scopedSlots=r,t._c=function(e,n,r,o){return Le(t,e,n,r,o,!1)},t.$createElement=function(e,n,r,o){return Le(t,e,n,r,o,!0)};var i=n&&n.data;Ct(t,"$attrs",i&&i.attrs||r,null,!0),Ct(t,"$listeners",e._parentListeners||r,null,!0)}(e),Xe(e,"beforeCreate"),function(t){var e=fe(t.$options.inject,t);e&&(Et(!1),Object.keys(e).forEach((function(n){Ct(t,n,e[n])})),Et(!0))}(e),vn(e),function(t){var e=t.$options.provide;e&&(t._provided="function"==typeof e?e.call(t):e)}(e),Xe(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}(En),function(t){var e={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",n),t.prototype.$set=Dt,t.prototype.$delete=Ot,t.prototype.$watch=function(t,e,n){if(l(e))return wn(this,t,e,n);(n=n||{}).user=!0;var r=new pn(this,t,e,n);if(n.immediate)try{e.call(this,r.value)}catch(t){Ut(t,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(En),function(t){var e=/^hook:/;t.prototype.$on=function(t,n){var r=this;if(Array.isArray(t))for(var o=0,i=t.length;o<i;o++)r.$on(t[o],n);else(r._events[t]||(r._events[t]=[])).push(n),e.test(t)&&(r._hasHookEvent=!0);return r},t.prototype.$once=function(t,e){var n=this;function r(){n.$off(t,r),e.apply(n,arguments)}return r.fn=e,n.$on(t,r),n},t.prototype.$off=function(t,e){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(t)){for(var r=0,o=t.length;r<o;r++)n.$off(t[r],e);return n}var i,a=n._events[t];if(!a)return n;if(!e)return n._events[t]=null,n;for(var s=a.length;s--;)if((i=a[s])===e||i.fn===e){a.splice(s,1);break}return n},t.prototype.$emit=function(t){var e=this,n=e._events[t];if(n){n=n.length>1?O(n):n;for(var r=O(arguments,1),o='event handler for "'+t+'"',i=0,a=n.length;i<a;i++)Vt(n[i],e,r,e,o)}return e}}(En),function(t){t.prototype._update=function(t,e){var n=this,r=n.$el,o=n._vnode,i=Ye(n);n._vnode=t,n.$el=o?n.__patch__(o,t):n.__patch__(n.$el,t,e,!1),i(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},t.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){Xe(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||y(e.$children,t),t._watcher&&t._watcher.teardown();for(var n=t._watchers.length;n--;)t._watchers[n].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),Xe(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}(En),function(t){je(t.prototype),t.prototype.$nextTick=function(t){return ee(t,this)},t.prototype._render=function(){var t,e=this,n=e.$options,r=n.render,o=n._parentVnode;o&&(e.$scopedSlots=he(o.data.scopedSlots,e.$slots,e.$scopedSlots)),e.$vnode=o;try{Ne=e,t=r.call(e._renderProxy,e.$createElement)}catch(n){Ut(n,e,"render"),t=e._vnode}finally{Ne=null}return Array.isArray(t)&&1===t.length&&(t=t[0]),t instanceof ht||(t=mt()),t.parent=o,t}}(En);var Sn=[String,RegExp,Array],$n={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:Sn,exclude:Sn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)On(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",(function(e){Dn(t,(function(t){return Cn(e,t)}))})),this.$watch("exclude",(function(e){Dn(t,(function(t){return!Cn(e,t)}))}))},render:function(){var t=this.$slots.default,e=He(t),n=e&&e.componentOptions;if(n){var r=kn(n),o=this.include,i=this.exclude;if(o&&(!r||!Cn(o,r))||i&&r&&Cn(i,r))return e;var a=this.cache,s=this.keys,u=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;a[u]?(e.componentInstance=a[u].componentInstance,y(s,u),s.push(u)):(a[u]=e,s.push(u),this.max&&s.length>parseInt(this.max)&&On(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};!function(t){var e={get:function(){return L}};Object.defineProperty(t,"config",e),t.util={warn:ut,extend:S,mergeOptions:It,defineReactive:Ct},t.set=Dt,t.delete=Ot,t.nextTick=ee,t.observable=function(t){return kt(t),t},t.options=Object.create(null),M.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,S(t.options.components,$n),function(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var n=O(arguments,1);return n.unshift(this),"function"==typeof t.install?t.install.apply(t,n):"function"==typeof t&&t.apply(null,n),e.push(t),this}}(t),function(t){t.mixin=function(t){return this.options=It(this.options,t),this}}(t),An(t),function(t){M.forEach((function(e){t[e]=function(t,n){return n?("component"===e&&l(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}}))}(t)}(En),Object.defineProperty(En.prototype,"$isServer",{get:rt}),Object.defineProperty(En.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(En,"FunctionalRenderContext",{value:Te}),En.version="2.6.12";var jn=m("style,class"),Tn=m("input,textarea,option,select,progress"),Pn=m("contenteditable,draggable,spellcheck"),Bn=m("events,caret,typing,plaintext-only"),Fn=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),In="http://www.w3.org/1999/xlink",Mn=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Rn=function(t){return Mn(t)?t.slice(6,t.length):""},Ln=function(t){return null==t||!1===t};function zn(t){for(var e=t.data,n=t,r=t;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(e=Nn(r.data,e));for(;i(n=n.parent);)n&&n.data&&(e=Nn(e,n.data));return function(t,e){if(i(t)||i(e))return Un(t,Vn(e));return""}(e.staticClass,e.class)}function Nn(t,e){return{staticClass:Un(t.staticClass,e.staticClass),class:i(t.class)?[t.class,e.class]:e.class}}function Un(t,e){return t?e?t+" "+e:t:e||""}function Vn(t){return Array.isArray(t)?function(t){for(var e,n="",r=0,o=t.length;r<o;r++)i(e=Vn(t[r]))&&""!==e&&(n&&(n+=" "),n+=e);return n}(t):u(t)?function(t){var e="";for(var n in t)t[n]&&(e&&(e+=" "),e+=n);return e}(t):"string"==typeof t?t:""}var Hn={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},qn=m("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Wn=m("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Jn=function(t){return qn(t)||Wn(t)};var Gn=Object.create(null);var Qn=m("text,number,password,search,email,tel,url");var Yn=Object.freeze({createElement:function(t,e){var n=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n},createElementNS:function(t,e){return document.createElementNS(Hn[t],e)},createTextNode:function(t){return document.createTextNode(t)},createComment:function(t){return document.createComment(t)},insertBefore:function(t,e,n){t.insertBefore(e,n)},removeChild:function(t,e){t.removeChild(e)},appendChild:function(t,e){t.appendChild(e)},parentNode:function(t){return t.parentNode},nextSibling:function(t){return t.nextSibling},tagName:function(t){return t.tagName},setTextContent:function(t,e){t.textContent=e},setStyleScope:function(t,e){t.setAttribute(e,"")}}),Kn={create:function(t,e){Zn(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Zn(t,!0),Zn(e))},destroy:function(t){Zn(t,!0)}};function Zn(t,e){var n=t.data.ref;if(i(n)){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?y(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(o)<0&&a[n].push(o):a[n]=[o]:a[n]=o}}var Xn=new ht("",{},[]),tr=["create","activate","update","remove","destroy"];function er(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&i(t.data)===i(e.data)&&function(t,e){if("input"!==t.tag)return!0;var n,r=i(n=t.data)&&i(n=n.attrs)&&n.type,o=i(n=e.data)&&i(n=n.attrs)&&n.type;return r===o||Qn(r)&&Qn(o)}(t,e)||a(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&o(e.asyncFactory.error))}function nr(t,e,n){var r,o,a={};for(r=e;r<=n;++r)i(o=t[r].key)&&(a[o]=r);return a}var rr={create:or,update:or,destroy:function(t){or(t,Xn)}};function or(t,e){(t.data.directives||e.data.directives)&&function(t,e){var n,r,o,i=t===Xn,a=e===Xn,s=ar(t.data.directives,t.context),u=ar(e.data.directives,e.context),c=[],l=[];for(n in u)r=s[n],o=u[n],r?(o.oldValue=r.value,o.oldArg=r.arg,ur(o,"update",e,t),o.def&&o.def.componentUpdated&&l.push(o)):(ur(o,"bind",e,t),o.def&&o.def.inserted&&c.push(o));if(c.length){var f=function(){for(var n=0;n<c.length;n++)ur(c[n],"inserted",e,t)};i?se(e,"insert",f):f()}l.length&&se(e,"postpatch",(function(){for(var n=0;n<l.length;n++)ur(l[n],"componentUpdated",e,t)}));if(!i)for(n in s)u[n]||ur(s[n],"unbind",t,t,a)}(t,e)}var ir=Object.create(null);function ar(t,e){var n,r,o=Object.create(null);if(!t)return o;for(n=0;n<t.length;n++)(r=t[n]).modifiers||(r.modifiers=ir),o[sr(r)]=r,r.def=Mt(e.$options,"directives",r.name);return o}function sr(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function ur(t,e,n,r,o){var i=t.def&&t.def[e];if(i)try{i(n.elm,t,n,r,o)}catch(r){Ut(r,n.context,"directive "+t.name+" "+e+" hook")}}var cr=[Kn,rr];function lr(t,e){var n=e.componentOptions;if(!(i(n)&&!1===n.Ctor.options.inheritAttrs||o(t.data.attrs)&&o(e.data.attrs))){var r,a,s=e.elm,u=t.data.attrs||{},c=e.data.attrs||{};for(r in i(c.__ob__)&&(c=e.data.attrs=S({},c)),c)a=c[r],u[r]!==a&&fr(s,r,a);for(r in(Q||K)&&c.value!==u.value&&fr(s,"value",c.value),u)o(c[r])&&(Mn(r)?s.removeAttributeNS(In,Rn(r)):Pn(r)||s.removeAttribute(r))}}function fr(t,e,n){t.tagName.indexOf("-")>-1?pr(t,e,n):Fn(e)?Ln(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Pn(e)?t.setAttribute(e,function(t,e){return Ln(e)||"false"===e?"false":"contenteditable"===t&&Bn(e)?e:"true"}(e,n)):Mn(e)?Ln(n)?t.removeAttributeNS(In,Rn(e)):t.setAttributeNS(In,e,n):pr(t,e,n)}function pr(t,e,n){if(Ln(n))t.removeAttribute(e);else{if(Q&&!Y&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var dr={create:lr,update:lr};function hr(t,e){var n=e.elm,r=e.data,a=t.data;if(!(o(r.staticClass)&&o(r.class)&&(o(a)||o(a.staticClass)&&o(a.class)))){var s=zn(e),u=n._transitionClasses;i(u)&&(s=Un(s,Vn(u))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var vr,mr={create:hr,update:hr};function gr(t,e,n){var r=vr;return function o(){var i=e.apply(null,arguments);null!==i&&wr(t,o,n,r)}}var yr=Jt&&!(X&&Number(X[1])<=53);function br(t,e,n,r){if(yr){var o=sn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}vr.addEventListener(t,e,et?{capture:n,passive:r}:n)}function wr(t,e,n,r){(r||vr).removeEventListener(t,e._wrapper||e,n)}function xr(t,e){if(!o(t.data.on)||!o(e.data.on)){var n=e.data.on||{},r=t.data.on||{};vr=e.elm,function(t){if(i(t.__r)){var e=Q?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}i(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),ae(n,r,br,wr,gr,e.context),vr=void 0}}var _r,Er={create:xr,update:xr};function Ar(t,e){if(!o(t.data.domProps)||!o(e.data.domProps)){var n,r,a=e.elm,s=t.data.domProps||{},u=e.data.domProps||{};for(n in i(u.__ob__)&&(u=e.data.domProps=S({},u)),s)n in u||(a[n]="");for(n in u){if(r=u[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var c=o(r)?"":String(r);kr(a,c)&&(a.value=c)}else if("innerHTML"===n&&Wn(a.tagName)&&o(a.innerHTML)){(_r=_r||document.createElement("div")).innerHTML="<svg>"+r+"</svg>";for(var l=_r.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(r!==s[n])try{a[n]=r}catch(t){}}}}function kr(t,e){return!t.composing&&("OPTION"===t.tagName||function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(t,e)||function(t,e){var n=t.value,r=t._vModifiers;if(i(r)){if(r.number)return v(n)!==v(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(t,e))}var Cr={create:Ar,update:Ar},Dr=x((function(t){var e={},n=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach((function(t){if(t){var r=t.split(n);r.length>1&&(e[r[0].trim()]=r[1].trim())}})),e}));function Or(t){var e=Sr(t.style);return t.staticStyle?S(t.staticStyle,e):e}function Sr(t){return Array.isArray(t)?$(t):"string"==typeof t?Dr(t):t}var $r,jr=/^--/,Tr=/\s*!important$/,Pr=function(t,e,n){if(jr.test(e))t.style.setProperty(e,n);else if(Tr.test(n))t.style.setProperty(C(e),n.replace(Tr,""),"important");else{var r=Fr(e);if(Array.isArray(n))for(var o=0,i=n.length;o<i;o++)t.style[r]=n[o];else t.style[r]=n}},Br=["Webkit","Moz","ms"],Fr=x((function(t){if($r=$r||document.createElement("div").style,"filter"!==(t=E(t))&&t in $r)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=0;n<Br.length;n++){var r=Br[n]+e;if(r in $r)return r}}));function Ir(t,e){var n=e.data,r=t.data;if(!(o(n.staticStyle)&&o(n.style)&&o(r.staticStyle)&&o(r.style))){var a,s,u=e.elm,c=r.staticStyle,l=r.normalizedStyle||r.style||{},f=c||l,p=Sr(e.data.style)||{};e.data.normalizedStyle=i(p.__ob__)?S({},p):p;var d=function(t,e){var n,r={};if(e)for(var o=t;o.componentInstance;)(o=o.componentInstance._vnode)&&o.data&&(n=Or(o.data))&&S(r,n);(n=Or(t.data))&&S(r,n);for(var i=t;i=i.parent;)i.data&&(n=Or(i.data))&&S(r,n);return r}(e,!0);for(s in f)o(d[s])&&Pr(u,s,"");for(s in d)(a=d[s])!==f[s]&&Pr(u,s,null==a?"":a)}}var Mr={create:Ir,update:Ir},Rr=/\s+/;function Lr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Rr).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function zr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(Rr).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?t.setAttribute("class",n):t.removeAttribute("class")}}function Nr(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&S(e,Ur(t.name||"v")),S(e,t),e}return"string"==typeof t?Ur(t):void 0}}var Ur=x((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Vr=q&&!Y,Hr="transition",qr="transitionend",Wr="animation",Jr="animationend";Vr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Hr="WebkitTransition",qr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Wr="WebkitAnimation",Jr="webkitAnimationEnd"));var Gr=q?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Qr(t){Gr((function(){Gr(t)}))}function Yr(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),Lr(t,e))}function Kr(t,e){t._transitionClasses&&y(t._transitionClasses,e),zr(t,e)}function Zr(t,e,n){var r=to(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s="transition"===o?qr:Jr,u=0,c=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++u>=a&&c()};setTimeout((function(){u<a&&c()}),i+1),t.addEventListener(s,l)}var Xr=/\b(transform|all)(,|$)/;function to(t,e){var n,r=window.getComputedStyle(t),o=(r[Hr+"Delay"]||"").split(", "),i=(r[Hr+"Duration"]||"").split(", "),a=eo(o,i),s=(r[Wr+"Delay"]||"").split(", "),u=(r[Wr+"Duration"]||"").split(", "),c=eo(s,u),l=0,f=0;return"transition"===e?a>0&&(n="transition",l=a,f=i.length):"animation"===e?c>0&&(n="animation",l=c,f=u.length):f=(n=(l=Math.max(a,c))>0?a>c?"transition":"animation":null)?"transition"===n?i.length:u.length:0,{type:n,timeout:l,propCount:f,hasTransform:"transition"===n&&Xr.test(r[Hr+"Property"])}}function eo(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max.apply(null,e.map((function(e,n){return no(e)+no(t[n])})))}function no(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function ro(t,e){var n=t.elm;i(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var r=Nr(t.data.transition);if(!o(r)&&!i(n._enterCb)&&1===n.nodeType){for(var a=r.css,s=r.type,c=r.enterClass,l=r.enterToClass,f=r.enterActiveClass,p=r.appearClass,d=r.appearToClass,h=r.appearActiveClass,m=r.beforeEnter,g=r.enter,y=r.afterEnter,b=r.enterCancelled,w=r.beforeAppear,x=r.appear,_=r.afterAppear,E=r.appearCancelled,A=r.duration,k=Qe,C=Qe.$vnode;C&&C.parent;)k=C.context,C=C.parent;var D=!k._isMounted||!t.isRootInsert;if(!D||x||""===x){var O=D&&p?p:c,S=D&&h?h:f,$=D&&d?d:l,j=D&&w||m,T=D&&"function"==typeof x?x:g,P=D&&_||y,B=D&&E||b,F=v(u(A)?A.enter:A);0;var M=!1!==a&&!Y,R=ao(T),L=n._enterCb=I((function(){M&&(Kr(n,$),Kr(n,S)),L.cancelled?(M&&Kr(n,O),B&&B(n)):P&&P(n),n._enterCb=null}));t.data.show||se(t,"insert",(function(){var e=n.parentNode,r=e&&e._pending&&e._pending[t.key];r&&r.tag===t.tag&&r.elm._leaveCb&&r.elm._leaveCb(),T&&T(n,L)})),j&&j(n),M&&(Yr(n,O),Yr(n,S),Qr((function(){Kr(n,O),L.cancelled||(Yr(n,$),R||(io(F)?setTimeout(L,F):Zr(n,s,L)))}))),t.data.show&&(e&&e(),T&&T(n,L)),M||R||L()}}}function oo(t,e){var n=t.elm;i(n._enterCb)&&(n._enterCb.cancelled=!0,n._enterCb());var r=Nr(t.data.transition);if(o(r)||1!==n.nodeType)return e();if(!i(n._leaveCb)){var a=r.css,s=r.type,c=r.leaveClass,l=r.leaveToClass,f=r.leaveActiveClass,p=r.beforeLeave,d=r.leave,h=r.afterLeave,m=r.leaveCancelled,g=r.delayLeave,y=r.duration,b=!1!==a&&!Y,w=ao(d),x=v(u(y)?y.leave:y);0;var _=n._leaveCb=I((function(){n.parentNode&&n.parentNode._pending&&(n.parentNode._pending[t.key]=null),b&&(Kr(n,l),Kr(n,f)),_.cancelled?(b&&Kr(n,c),m&&m(n)):(e(),h&&h(n)),n._leaveCb=null}));g?g(E):E()}function E(){_.cancelled||(!t.data.show&&n.parentNode&&((n.parentNode._pending||(n.parentNode._pending={}))[t.key]=t),p&&p(n),b&&(Yr(n,c),Yr(n,f),Qr((function(){Kr(n,c),_.cancelled||(Yr(n,l),w||(io(x)?setTimeout(_,x):Zr(n,s,_)))}))),d&&d(n,_),b||w||_())}}function io(t){return"number"==typeof t&&!isNaN(t)}function ao(t){if(o(t))return!1;var e=t.fns;return i(e)?ao(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function so(t,e){!0!==e.data.show&&ro(e)}var uo=function(t){var e,n,r={},u=t.modules,c=t.nodeOps;for(e=0;e<tr.length;++e)for(r[tr[e]]=[],n=0;n<u.length;++n)i(u[n][tr[e]])&&r[tr[e]].push(u[n][tr[e]]);function l(t){var e=c.parentNode(t);i(e)&&c.removeChild(e,t)}function f(t,e,n,o,s,u,l){if(i(t.elm)&&i(u)&&(t=u[l]=yt(t)),t.isRootInsert=!s,!function(t,e,n,o){var s=t.data;if(i(s)){var u=i(t.componentInstance)&&s.keepAlive;if(i(s=s.hook)&&i(s=s.init)&&s(t,!1),i(t.componentInstance))return p(t,e),d(n,t.elm,o),a(u)&&function(t,e,n,o){var a,s=t;for(;s.componentInstance;)if(s=s.componentInstance._vnode,i(a=s.data)&&i(a=a.transition)){for(a=0;a<r.activate.length;++a)r.activate[a](Xn,s);e.push(s);break}d(n,t.elm,o)}(t,e,n,o),!0}}(t,e,n,o)){var f=t.data,v=t.children,m=t.tag;i(m)?(t.elm=t.ns?c.createElementNS(t.ns,m):c.createElement(m,t),y(t),h(t,v,e),i(f)&&g(t,e),d(n,t.elm,o)):a(t.isComment)?(t.elm=c.createComment(t.text),d(n,t.elm,o)):(t.elm=c.createTextNode(t.text),d(n,t.elm,o))}}function p(t,e){i(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,v(t)?(g(t,e),y(t)):(Zn(t),e.push(t))}function d(t,e,n){i(t)&&(i(n)?c.parentNode(n)===t&&c.insertBefore(t,e,n):c.appendChild(t,e))}function h(t,e,n){if(Array.isArray(e)){0;for(var r=0;r<e.length;++r)f(e[r],n,t.elm,null,!0,e,r)}else s(t.text)&&c.appendChild(t.elm,c.createTextNode(String(t.text)))}function v(t){for(;t.componentInstance;)t=t.componentInstance._vnode;return i(t.tag)}function g(t,n){for(var o=0;o<r.create.length;++o)r.create[o](Xn,t);i(e=t.data.hook)&&(i(e.create)&&e.create(Xn,t),i(e.insert)&&n.push(t))}function y(t){var e;if(i(e=t.fnScopeId))c.setStyleScope(t.elm,e);else for(var n=t;n;)i(e=n.context)&&i(e=e.$options._scopeId)&&c.setStyleScope(t.elm,e),n=n.parent;i(e=Qe)&&e!==t.context&&e!==t.fnContext&&i(e=e.$options._scopeId)&&c.setStyleScope(t.elm,e)}function b(t,e,n,r,o,i){for(;r<=o;++r)f(n[r],i,t,e,!1,n,r)}function w(t){var e,n,o=t.data;if(i(o))for(i(e=o.hook)&&i(e=e.destroy)&&e(t),e=0;e<r.destroy.length;++e)r.destroy[e](t);if(i(e=t.children))for(n=0;n<t.children.length;++n)w(t.children[n])}function x(t,e,n){for(;e<=n;++e){var r=t[e];i(r)&&(i(r.tag)?(_(r),w(r)):l(r.elm))}}function _(t,e){if(i(e)||i(t.data)){var n,o=r.remove.length+1;for(i(e)?e.listeners+=o:e=function(t,e){function n(){0==--n.listeners&&l(t)}return n.listeners=e,n}(t.elm,o),i(n=t.componentInstance)&&i(n=n._vnode)&&i(n.data)&&_(n,e),n=0;n<r.remove.length;++n)r.remove[n](t,e);i(n=t.data.hook)&&i(n=n.remove)?n(t,e):e()}else l(t.elm)}function E(t,e,n,r){for(var o=n;o<r;o++){var a=e[o];if(i(a)&&er(t,a))return o}}function A(t,e,n,s,u,l){if(t!==e){i(e.elm)&&i(s)&&(e=s[u]=yt(e));var p=e.elm=t.elm;if(a(t.isAsyncPlaceholder))i(e.asyncFactory.resolved)?D(t.elm,e,n):e.isAsyncPlaceholder=!0;else if(a(e.isStatic)&&a(t.isStatic)&&e.key===t.key&&(a(e.isCloned)||a(e.isOnce)))e.componentInstance=t.componentInstance;else{var d,h=e.data;i(h)&&i(d=h.hook)&&i(d=d.prepatch)&&d(t,e);var m=t.children,g=e.children;if(i(h)&&v(e)){for(d=0;d<r.update.length;++d)r.update[d](t,e);i(d=h.hook)&&i(d=d.update)&&d(t,e)}o(e.text)?i(m)&&i(g)?m!==g&&function(t,e,n,r,a){var s,u,l,p=0,d=0,h=e.length-1,v=e[0],m=e[h],g=n.length-1,y=n[0],w=n[g],_=!a;for(0;p<=h&&d<=g;)o(v)?v=e[++p]:o(m)?m=e[--h]:er(v,y)?(A(v,y,r,n,d),v=e[++p],y=n[++d]):er(m,w)?(A(m,w,r,n,g),m=e[--h],w=n[--g]):er(v,w)?(A(v,w,r,n,g),_&&c.insertBefore(t,v.elm,c.nextSibling(m.elm)),v=e[++p],w=n[--g]):er(m,y)?(A(m,y,r,n,d),_&&c.insertBefore(t,m.elm,v.elm),m=e[--h],y=n[++d]):(o(s)&&(s=nr(e,p,h)),o(u=i(y.key)?s[y.key]:E(y,e,p,h))?f(y,r,t,v.elm,!1,n,d):er(l=e[u],y)?(A(l,y,r,n,d),e[u]=void 0,_&&c.insertBefore(t,l.elm,v.elm)):f(y,r,t,v.elm,!1,n,d),y=n[++d]);p>h?b(t,o(n[g+1])?null:n[g+1].elm,n,d,g,r):d>g&&x(e,p,h)}(p,m,g,n,l):i(g)?(i(t.text)&&c.setTextContent(p,""),b(p,null,g,0,g.length-1,n)):i(m)?x(m,0,m.length-1):i(t.text)&&c.setTextContent(p,""):t.text!==e.text&&c.setTextContent(p,e.text),i(h)&&i(d=h.hook)&&i(d=d.postpatch)&&d(t,e)}}}function k(t,e,n){if(a(n)&&i(t.parent))t.parent.data.pendingInsert=e;else for(var r=0;r<e.length;++r)e[r].data.hook.insert(e[r])}var C=m("attrs,class,staticClass,staticStyle,key");function D(t,e,n,r){var o,s=e.tag,u=e.data,c=e.children;if(r=r||u&&u.pre,e.elm=t,a(e.isComment)&&i(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(i(u)&&(i(o=u.hook)&&i(o=o.init)&&o(e,!0),i(o=e.componentInstance)))return p(e,n),!0;if(i(s)){if(i(c))if(t.hasChildNodes())if(i(o=u)&&i(o=o.domProps)&&i(o=o.innerHTML)){if(o!==t.innerHTML)return!1}else{for(var l=!0,f=t.firstChild,d=0;d<c.length;d++){if(!f||!D(f,c[d],n,r)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else h(e,c,n);if(i(u)){var v=!1;for(var m in u)if(!C(m)){v=!0,g(e,n);break}!v&&u.class&&re(u.class)}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,n,s){if(!o(e)){var u,l=!1,p=[];if(o(t))l=!0,f(e,p);else{var d=i(t.nodeType);if(!d&&er(t,e))A(t,e,p,null,null,s);else{if(d){if(1===t.nodeType&&t.hasAttribute("data-server-rendered")&&(t.removeAttribute("data-server-rendered"),n=!0),a(n)&&D(t,e,p))return k(e,p,!0),t;u=t,t=new ht(c.tagName(u).toLowerCase(),{},[],void 0,u)}var h=t.elm,m=c.parentNode(h);if(f(e,p,h._leaveCb?null:m,c.nextSibling(h)),i(e.parent))for(var g=e.parent,y=v(e);g;){for(var b=0;b<r.destroy.length;++b)r.destroy[b](g);if(g.elm=e.elm,y){for(var _=0;_<r.create.length;++_)r.create[_](Xn,g);var E=g.data.hook.insert;if(E.merged)for(var C=1;C<E.fns.length;C++)E.fns[C]()}else Zn(g);g=g.parent}i(m)?x([t],0,0):i(t.tag)&&w(t)}}return k(e,p,l),e.elm}i(t)&&w(t)}}({nodeOps:Yn,modules:[dr,mr,Er,Cr,Mr,q?{create:so,activate:so,remove:function(t,e){!0!==t.data.show?oo(t,e):e()}}:{}].concat(cr)});Y&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&go(t,"input")}));var co={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?se(n,"postpatch",(function(){co.componentUpdated(t,e,n)})):lo(t,e,n.context),t._vOptions=[].map.call(t.options,ho)):("textarea"===n.tag||Qn(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",vo),t.addEventListener("compositionend",mo),t.addEventListener("change",mo),Y&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){lo(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,ho);if(o.some((function(t,e){return!B(t,r[e])})))(t.multiple?e.value.some((function(t){return po(t,o)})):e.value!==e.oldValue&&po(e.value,o))&&go(t,"change")}}};function lo(t,e,n){fo(t,e,n),(Q||K)&&setTimeout((function(){fo(t,e,n)}),0)}function fo(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var i,a,s=0,u=t.options.length;s<u;s++)if(a=t.options[s],o)i=F(r,ho(a))>-1,a.selected!==i&&(a.selected=i);else if(B(ho(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function po(t,e){return e.every((function(e){return!B(e,t)}))}function ho(t){return"_value"in t?t._value:t.value}function vo(t){t.target.composing=!0}function mo(t){t.target.composing&&(t.target.composing=!1,go(t.target,"input"))}function go(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function yo(t){return!t.componentInstance||t.data&&t.data.transition?t:yo(t.componentInstance._vnode)}var bo={model:co,show:{bind:function(t,e,n){var r=e.value,o=(n=yo(n)).data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,ro(n,(function(){t.style.display=i}))):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value;!r!=!e.oldValue&&((n=yo(n)).data&&n.data.transition?(n.data.show=!0,r?ro(n,(function(){t.style.display=t.__vOriginalDisplay})):oo(n,(function(){t.style.display="none"}))):t.style.display=r?t.__vOriginalDisplay:"none")},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}}},wo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function xo(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?xo(He(e.children)):t}function _o(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var i in o)e[E(i)]=o[i];return e}function Eo(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}var Ao=function(t){return t.tag||Ve(t)},ko=function(t){return"show"===t.name},Co={name:"transition",props:wo,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(Ao)).length){0;var r=this.mode;0;var o=n[0];if(function(t){for(;t=t.parent;)if(t.data.transition)return!0}(this.$vnode))return o;var i=xo(o);if(!i)return o;if(this._leaving)return Eo(t,o);var a="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?a+"comment":a+i.tag:s(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var u=(i.data||(i.data={})).transition=_o(this),c=this._vnode,l=xo(c);if(i.data.directives&&i.data.directives.some(ko)&&(i.data.show=!0),l&&l.data&&!function(t,e){return e.key===t.key&&e.tag===t.tag}(i,l)&&!Ve(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=S({},u);if("out-in"===r)return this._leaving=!0,se(f,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),Eo(t,o);if("in-out"===r){if(Ve(i))return c;var p,d=function(){p()};se(u,"afterEnter",d),se(u,"enterCancelled",d),se(f,"delayLeave",(function(t){p=t}))}}return o}}},Do=S({tag:String,moveClass:String},wo);function Oo(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function So(t){t.data.newPos=t.elm.getBoundingClientRect()}function $o(t){var e=t.data.pos,n=t.data.newPos,r=e.left-n.left,o=e.top-n.top;if(r||o){t.data.moved=!0;var i=t.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+o+"px)",i.transitionDuration="0s"}}delete Do.mode;var jo={Transition:Co,TransitionGroup:{props:Do,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=Ye(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=_o(this),s=0;s<o.length;s++){var u=o[s];if(u.tag)if(null!=u.key&&0!==String(u.key).indexOf("__vlist"))i.push(u),n[u.key]=u,(u.data||(u.data={})).transition=a;else;}if(r){for(var c=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?c.push(p):l.push(p)}this.kept=t(e,null,c),this.removed=l}return t(e,null,i)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(Oo),t.forEach(So),t.forEach($o),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var n=t.elm,r=n.style;Yr(n,e),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(qr,n._moveCb=function t(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(qr,t),n._moveCb=null,Kr(n,e))})}})))},methods:{hasMove:function(t,e){if(!Vr)return!1;if(this._hasMove)return this._hasMove;var n=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){zr(n,t)})),Lr(n,e),n.style.display="none",this.$el.appendChild(n);var r=to(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};En.config.mustUseProp=function(t,e,n){return"value"===n&&Tn(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},En.config.isReservedTag=Jn,En.config.isReservedAttr=jn,En.config.getTagNamespace=function(t){return Wn(t)?"svg":"math"===t?"math":void 0},En.config.isUnknownElement=function(t){if(!q)return!0;if(Jn(t))return!1;if(t=t.toLowerCase(),null!=Gn[t])return Gn[t];var e=document.createElement(t);return t.indexOf("-")>-1?Gn[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:Gn[t]=/HTMLUnknownElement/.test(e.toString())},S(En.options.directives,bo),S(En.options.components,jo),En.prototype.__patch__=q?uo:j,En.prototype.$mount=function(t,e){return function(t,e,n){var r;return t.$el=e,t.$options.render||(t.$options.render=mt),Xe(t,"beforeMount"),r=function(){t._update(t._render(),n)},new pn(t,r,j,{before:function(){t._isMounted&&!t._isDestroyed&&Xe(t,"beforeUpdate")}},!0),n=!1,null==t.$vnode&&(t._isMounted=!0,Xe(t,"mounted")),t}(this,t=t&&q?function(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}(t):void 0,e)},q&&setTimeout((function(){L.devtools&&ot&&ot.emit("init",En)}),0),e.default=En},function(t,e,n){var r=n(3),o=n(30).f,i=n(22),a=n(15),s=n(99),u=n(147),c=n(78);t.exports=function(t,e){var n,l,f,p,d,h=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[h]||s(h,{}):(r[h]||{}).prototype)for(l in e){if(p=e[l],f=t.noTargetGet?(d=o(n,l))&&d.value:n[l],!c(v?l:h+(m?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(n,l,p,t)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||function(){return this}()||Function("return this")()},function(t,e,n){var r=n(3),o=n(73),i=n(11),a=n(74),s=n(101),u=n(142),c=o("wks"),l=r.Symbol,f=u?l:l&&l.withoutSetter||a;t.exports=function(t){return i(c,t)&&(s||"string"==typeof c[t])||(s&&i(l,t)?c[t]=l[t]:c[t]=f("Symbol."+t)),c[t]}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));n(69),n(45),n(20),n(227),n(59),n(60),n(165),n(363),n(95);var r=n(65);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}},function(t,e,n){var r=n(2);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){var r=n(5);t.exports=function(t){if(!r(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,s){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):o&&(u=s?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,e){return u.call(e),l(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,u):[u]}return{exports:t,options:c}}n.d(e,"a",(function(){return r}))},function(t,e,n){var r=n(7),o=n(140),i=n(8),a=n(40),s=Object.defineProperty;e.f=r?s:function(t,e,n){if(i(t),e=a(e,!0),i(n),o)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(12),o={}.hasOwnProperty;t.exports=function(t,e){return o.call(r(t),e)}},function(t,e,n){var r=n(18);t.exports=function(t){return Object(r(t))}},function(t,e,n){"use strict";var r=n(206),o=Object.prototype.toString;function i(t){return"[object Array]"===o.call(t)}function a(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function u(t){if("[object Object]"!==o.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function c(t){return"[object Function]"===o.call(t)}function l(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),i(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:u,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:c,isStream:function(t){return s(t)&&c(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function t(){var e={};function n(n,r){u(e[r])&&u(n)?e[r]=t(e[r],n):u(n)?e[r]=t({},n):i(n)?e[r]=n.slice():e[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return e},extend:function(t,e,n){return l(e,(function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,n){var r=n(51),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e,n){var r=n(3),o=n(22),i=n(11),a=n(99),s=n(104),u=n(42),c=u.get,l=u.enforce,f=String(String).split("String");(t.exports=function(t,e,n,s){var u,c=!!s&&!!s.unsafe,p=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||o(n,"name",e),(u=l(n)).source||(u.source=f.join("string"==typeof e?e:""))),t!==r?(c?!d&&t[e]&&(p=!0):delete t[e],p?t[e]=n:o(t,e,n)):p?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(0); +/** + * vue-class-component v7.2.6 + * (c) 2015-present Evan You + * @license MIT + */function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function s(){return"undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys}function u(t,e){c(t,e),Object.getOwnPropertyNames(e.prototype).forEach((function(n){c(t.prototype,e.prototype,n)})),Object.getOwnPropertyNames(e).forEach((function(n){c(t,e,n)}))}function c(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach((function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)}))}var l={__proto__:[]}instanceof Array;function f(t){return function(e,n,r){var o="function"==typeof e?e:e.constructor;o.__decorators__||(o.__decorators__=[]),"number"!=typeof r&&(r=void 0),o.__decorators__.push((function(e){return t(e,n,r)}))}}function p(t,e){var n=e.prototype._init;e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var r in t.$options.props)t.hasOwnProperty(r)||n.push(r);n.forEach((function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},configurable:!0})}))};var r=new e;e.prototype._init=n;var o={};return Object.keys(r).forEach((function(t){void 0!==r[t]&&(o[t]=r[t])})),o}var d=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(t){if("constructor"!==t)if(d.indexOf(t)>-1)e[t]=n[t];else{var r=Object.getOwnPropertyDescriptor(n,t);void 0!==r.value?"function"==typeof r.value?(e.methods||(e.methods={}))[t]=r.value:(e.mixins||(e.mixins=[])).push({data:function(){return i({},t,r.value)}}):(r.get||r.set)&&((e.computed||(e.computed={}))[t]={get:r.get,set:r.set})}})),(e.mixins||(e.mixins=[])).push({data:function(){return p(this,t)}});var o=t.__decorators__;o&&(o.forEach((function(t){return t(e)})),delete t.__decorators__);var a=Object.getPrototypeOf(t.prototype),c=a instanceof r.default?a.constructor:r.default,l=c.extend(e);return m(l,t,c),s()&&u(l,t),l}var v={prototype:!0,arguments:!0,callee:!0,caller:!0};function m(t,e,n){Object.getOwnPropertyNames(e).forEach((function(r){if(!v[r]){var i=Object.getOwnPropertyDescriptor(t,r);if(!i||i.configurable){var a,s,u=Object.getOwnPropertyDescriptor(e,r);if(!l){if("cid"===r)return;var c=Object.getOwnPropertyDescriptor(n,r);if(a=u.value,s=o(a),null!=a&&("object"===s||"function"===s)&&c&&c.value===u.value)return}0,Object.defineProperty(t,r,u)}}}))}function g(t){return"function"==typeof t?h(t):function(e){return h(e,t)}}g.registerHooks=function(t){d.push.apply(d,a(t))},e.b=g},function(t,e,n){var r=n(108),o=n(15),i=n(251);r||o(Object.prototype,"toString",i,{unsafe:!0})},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(1),o=n(43).filter;r({target:"Array",proto:!0,forced:!n(71)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(52),o=n(18);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(7),o=n(10),i=n(53);t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";var r=n(163).charAt,o=n(42),i=n(146),a=o.set,s=o.getterFor("String Iterator");i(String,"String",(function(t){a(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=s(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=r(n,o),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){t.exports=n(397)},function(t,e,n){var r=n(3),o=n(164),i=n(139),a=n(22),s=n(4),u=s("iterator"),c=s("toStringTag"),l=i.values;for(var f in o){var p=r[f],d=p&&p.prototype;if(d){if(d[u]!==l)try{a(d,u,l)}catch(t){d[u]=l}if(d[c]||a(d,c,f),o[f])for(var h in i)if(d[h]!==i[h])try{a(d,h,i[h])}catch(t){d[h]=i[h]}}}},function(t,e,n){var r=n(178),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n(95);function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e,n){var r=n(141),o=n(3),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},function(t,e,n){var r=n(7),o=n(105),i=n(53),a=n(21),s=n(40),u=n(11),c=n(140),l=Object.getOwnPropertyDescriptor;e.f=r?l:function(t,e){if(t=a(t),e=s(e,!0),c)try{return l(t,e)}catch(t){}if(u(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){"use strict";var r=n(1),o=n(5),i=n(58),a=n(132),s=n(14),u=n(21),c=n(70),l=n(4),f=n(71)("slice"),p=l("species"),d=[].slice,h=Math.max;r({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var n,r,l,f=u(this),v=s(f.length),m=a(t,v),g=a(void 0===e?v:e,v);if(i(f)&&("function"!=typeof(n=f.constructor)||n!==Array&&!i(n.prototype)?o(n)&&null===(n=n[p])&&(n=void 0):n=void 0,n===Array||void 0===n))return d.call(f,m,g);for(r=new(void 0===n?Array:n)(h(g-m,0)),l=0;m<g;m++,l++)m in f&&c(r,l,f[m]);return r.length=l,r}})},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=!1},function(t,e,n){var r=n(280),o=n(283);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(385),o=n(204),i=/[T ]/,a=/:/,s=/^(\d{2})$/,u=[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],c=/^(\d{4})/,l=[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],f=/^-(\d{2})$/,p=/^-?(\d{3})$/,d=/^-?(\d{2})-?(\d{2})$/,h=/^-?W(\d{2})$/,v=/^-?W(\d{2})-?(\d{1})$/,m=/^(\d{2}([.,]\d*)?)$/,g=/^(\d{2}):?(\d{2}([.,]\d*)?)$/,y=/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,b=/([Z+-].*)$/,w=/^(Z)$/,x=/^([+-])(\d{2})$/,_=/^([+-])(\d{2}):?(\d{2})$/;function E(t,e,n){e=e||0,n=n||0;var r=new Date(0);r.setUTCFullYear(t,0,4);var o=7*e+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}t.exports=function(t,e){if(o(t))return new Date(t.getTime());if("string"!=typeof t)return new Date(t);var n=(e||{}).additionalDigits;n=null==n?2:Number(n);var A=function(t){var e,n={},r=t.split(i);a.test(r[0])?(n.date=null,e=r[0]):(n.date=r[0],e=r[1]);if(e){var o=b.exec(e);o?(n.time=e.replace(o[1],""),n.timezone=o[1]):n.time=e}return n}(t),k=function(t,e){var n,r=u[e],o=l[e];if(n=c.exec(t)||o.exec(t)){var i=n[1];return{year:parseInt(i,10),restDateString:t.slice(i.length)}}if(n=s.exec(t)||r.exec(t)){var a=n[1];return{year:100*parseInt(a,10),restDateString:t.slice(a.length)}}return{year:null}}(A.date,n),C=k.year,D=function(t,e){if(null===e)return null;var n,r,o,i;if(0===t.length)return(r=new Date(0)).setUTCFullYear(e),r;if(n=f.exec(t))return r=new Date(0),o=parseInt(n[1],10)-1,r.setUTCFullYear(e,o),r;if(n=p.exec(t)){r=new Date(0);var a=parseInt(n[1],10);return r.setUTCFullYear(e,0,a),r}if(n=d.exec(t)){r=new Date(0),o=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return r.setUTCFullYear(e,o,s),r}if(n=h.exec(t))return i=parseInt(n[1],10)-1,E(e,i);if(n=v.exec(t)){i=parseInt(n[1],10)-1;var u=parseInt(n[2],10)-1;return E(e,i,u)}return null}(k.restDateString,C);if(D){var O,S=D.getTime(),$=0;if(A.time&&($=function(t){var e,n,r;if(e=m.exec(t))return(n=parseFloat(e[1].replace(",",".")))%24*36e5;if(e=g.exec(t))return n=parseInt(e[1],10),r=parseFloat(e[2].replace(",",".")),n%24*36e5+6e4*r;if(e=y.exec(t)){n=parseInt(e[1],10),r=parseInt(e[2],10);var o=parseFloat(e[3].replace(",","."));return n%24*36e5+6e4*r+1e3*o}return null}(A.time)),A.timezone)O=6e4*function(t){var e,n;if(e=w.exec(t))return 0;if(e=x.exec(t))return n=60*parseInt(e[2],10),"+"===e[1]?-n:n;if(e=_.exec(t))return n=60*parseInt(e[2],10)+parseInt(e[3],10),"+"===e[1]?-n:n;return 0}(A.timezone);else{var j=S+$,T=new Date(j);O=r(T);var P=new Date(j);P.setDate(T.getDate()+1);var B=r(P)-r(T);B>0&&(O+=B)}return new Date(S+$+O)}return new Date(t)}},function(t,e,n){"use strict";var r=n(1),o=n(43).map;r({target:"Array",proto:!0,forced:!n(71)("map")},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(1),o=n(85);r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"i",(function(){return a})),n.d(e,"f",(function(){return u})),n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"d",(function(){return f})),n.d(e,"e",(function(){return p})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return h})),n.d(e,"j",(function(){return v})),n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return y}));n(38),n(48),n(231),n(362),n(176),n(37),n(59),n(60),n(20),n(84),n(49),n(68),n(232),n(233);var r=/#.*$/,o=/\.(md|html)$/,i=/\/$/,a=/^(https?:|mailto:|tel:)/;function s(t){return decodeURI(t).replace(r,"").replace(o,"")}function u(t){return a.test(t)}function c(t){return/^mailto:/.test(t)}function l(t){return/^tel:/.test(t)}function f(t){if(u(t))return t;var e=t.match(r),n=e?e[0]:"",o=s(t);return i.test(o)?t:o+".html"+n}function p(t,e){var n=t.hash,o=function(t){var e=t.match(r);if(e)return e[0]}(e);return(!o||n===o)&&s(t.path)===s(e)}function d(t,e,n){n&&(e=function(t,e,n){var r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;var o=e.split("/");n&&o[o.length-1]||o.pop();for(var i=t.replace(/^\//,"").split("/"),a=0;a<i.length;a++){var s=i[a];".."===s?o.pop():"."!==s&&o.push(s)}""!==o[0]&&o.unshift("");return o.join("/")}(e,n));for(var r=s(e),o=0;o<t.length;o++)if(s(t[o].regularPath)===r)return Object.assign({},t[o],{type:"page",path:f(t[o].path)});return console.error('[vuepress] No matching page found for sidebar item "'.concat(e,'"')),{}}function h(t,e,n,r){var o=n.pages,i=n.themeConfig,a=function(t,e){if(Array.isArray(e))return{base:"/",config:e};for(var n in e)if(0===(r=t,/(\.html|\/)$/.test(r)?r:r+"/").indexOf(encodeURI(n)))return{base:n,config:e[n]};var r;return{}}(e,(r&&i.locales&&i.locales[r]||i).sidebar||i.sidebar),s=a.base,u=a.config;return u?u.map((function(t){return function t(e,n,r){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if("string"==typeof e)return d(n,e,r);if(Array.isArray(e))return Object.assign(d(n,e[0],r),{title:e[1]});o>3&&console.error("[vuepress] detected a too deep nested sidebar group.");var i=e.children||[];return 0===i.length&&e.path?Object.assign(d(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,children:i.map((function(e){return t(e,n,r,o+1)})),collapsable:!1!==e.collapsable}}(t,o,s)})):[]}function v(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}function m(t){return t?new Date(t).getTime():0}function g(t,e){var n=m(t.frontmatter.date),r=m(e.frontmatter.date);return 0===n||0===r?0:r-n}function y(t){var e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.append(e)}},function(t,e,n){var r=n(5);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r,o=n(8),i=n(143),a=n(103),s=n(55),u=n(145),c=n(100),l=n(77),f=l("IE_PROTO"),p=function(){},d=function(t){return"<script>"+t+"<\/script>"},h=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;h=r?function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e}(r):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F);for(var n=a.length;n--;)delete h.prototype[a[n]];return h()};s[f]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(p.prototype=o(t),n=new p,p.prototype=null,n[f]=t):n=h(),void 0===e?n:i(n,e)}},function(t,e,n){var r,o,i,a=n(236),s=n(3),u=n(5),c=n(22),l=n(11),f=n(98),p=n(77),d=n(55),h=s.WeakMap;if(a||f.state){var v=f.state||(f.state=new h),m=v.get,g=v.has,y=v.set;r=function(t,e){if(g.call(v,t))throw new TypeError("Object already initialized");return e.facade=t,y.call(v,t,e),e},o=function(t){return m.call(v,t)||{}},i=function(t){return g.call(v,t)}}else{var b=p("state");d[b]=!0,r=function(t,e){if(l(t,b))throw new TypeError("Object already initialized");return e.facade=t,c(t,b,e),e},o=function(t){return l(t,b)?t[b]:{}},i=function(t){return l(t,b)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(81),o=n(52),i=n(12),a=n(14),s=n(133),u=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,l=4==t,f=6==t,p=7==t,d=5==t||f;return function(h,v,m,g){for(var y,b,w=i(h),x=o(w),_=r(v,m,3),E=a(x.length),A=0,k=g||s,C=e?k(h,E):n||p?k(h,0):void 0;E>A;A++)if((d||A in x)&&(b=_(y=x[A],A,w),t))if(e)C[A]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return A;case 2:u.call(C,y)}else switch(t){case 4:return!1;case 7:u.call(C,y)}return f?-1:c||l?l:C}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){throw 1},1)}))}},function(t,e,n){"use strict";var r=n(1),o=n(3),i=n(29),a=n(34),s=n(7),u=n(101),c=n(142),l=n(2),f=n(11),p=n(58),d=n(5),h=n(8),v=n(12),m=n(21),g=n(40),y=n(53),b=n(41),w=n(76),x=n(57),_=n(256),E=n(106),A=n(30),k=n(10),C=n(105),D=n(22),O=n(15),S=n(73),$=n(77),j=n(55),T=n(74),P=n(4),B=n(172),F=n(173),I=n(79),M=n(42),R=n(43).forEach,L=$("hidden"),z=P("toPrimitive"),N=M.set,U=M.getterFor("Symbol"),V=Object.prototype,H=o.Symbol,q=i("JSON","stringify"),W=A.f,J=k.f,G=_.f,Q=C.f,Y=S("symbols"),K=S("op-symbols"),Z=S("string-to-symbol-registry"),X=S("symbol-to-string-registry"),tt=S("wks"),et=o.QObject,nt=!et||!et.prototype||!et.prototype.findChild,rt=s&&l((function(){return 7!=b(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=W(V,e);r&&delete V[e],J(t,e,n),r&&t!==V&&J(V,e,r)}:J,ot=function(t,e){var n=Y[t]=b(H.prototype);return N(n,{type:"Symbol",tag:t,description:e}),s||(n.description=e),n},it=c?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof H},at=function(t,e,n){t===V&&at(K,e,n),h(t);var r=g(e,!0);return h(n),f(Y,r)?(n.enumerable?(f(t,L)&&t[L][r]&&(t[L][r]=!1),n=b(n,{enumerable:y(0,!1)})):(f(t,L)||J(t,L,y(1,{})),t[L][r]=!0),rt(t,r,n)):J(t,r,n)},st=function(t,e){h(t);var n=m(e),r=w(n).concat(ft(n));return R(r,(function(e){s&&!ut.call(n,e)||at(t,e,n[e])})),t},ut=function(t){var e=g(t,!0),n=Q.call(this,e);return!(this===V&&f(Y,e)&&!f(K,e))&&(!(n||!f(this,e)||!f(Y,e)||f(this,L)&&this[L][e])||n)},ct=function(t,e){var n=m(t),r=g(e,!0);if(n!==V||!f(Y,r)||f(K,r)){var o=W(n,r);return!o||!f(Y,r)||f(n,L)&&n[L][r]||(o.enumerable=!0),o}},lt=function(t){var e=G(m(t)),n=[];return R(e,(function(t){f(Y,t)||f(j,t)||n.push(t)})),n},ft=function(t){var e=t===V,n=G(e?K:m(t)),r=[];return R(n,(function(t){!f(Y,t)||e&&!f(V,t)||r.push(Y[t])})),r};(u||(O((H=function(){if(this instanceof H)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=T(t),n=function(t){this===V&&n.call(K,t),f(this,L)&&f(this[L],e)&&(this[L][e]=!1),rt(this,e,y(1,t))};return s&&nt&&rt(V,e,{configurable:!0,set:n}),ot(e,t)}).prototype,"toString",(function(){return U(this).tag})),O(H,"withoutSetter",(function(t){return ot(T(t),t)})),C.f=ut,k.f=at,A.f=ct,x.f=_.f=lt,E.f=ft,B.f=function(t){return ot(P(t),t)},s&&(J(H.prototype,"description",{configurable:!0,get:function(){return U(this).description}}),a||O(V,"propertyIsEnumerable",ut,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:H}),R(w(tt),(function(t){F(t)})),r({target:"Symbol",stat:!0,forced:!u},{for:function(t){var e=String(t);if(f(Z,e))return Z[e];var n=H(e);return Z[e]=n,X[n]=e,n},keyFor:function(t){if(!it(t))throw TypeError(t+" is not a symbol");if(f(X,t))return X[t]},useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),r({target:"Object",stat:!0,forced:!u,sham:!s},{create:function(t,e){return void 0===e?b(t):st(b(t),e)},defineProperty:at,defineProperties:st,getOwnPropertyDescriptor:ct}),r({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:lt,getOwnPropertySymbols:ft}),r({target:"Object",stat:!0,forced:l((function(){E.f(1)}))},{getOwnPropertySymbols:function(t){return E.f(v(t))}}),q)&&r({target:"JSON",stat:!0,forced:!u||l((function(){var t=H();return"[null]"!=q([t])||"{}"!=q({a:t})||"{}"!=q(Object(t))}))},{stringify:function(t,e,n){for(var r,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(r=e,(d(e)||void 0!==t)&&!it(t))return p(e)||(e=function(t,e){if("function"==typeof r&&(e=r.call(this,t,e)),!it(e))return e}),o[1]=e,q.apply(null,o)}});H.prototype[z]||D(H.prototype,z,H.prototype.valueOf),I(H,"Symbol"),j[L]=!0},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){"use strict";var r=n(373),o=n(383),i=n(127);t.exports={formats:i,parse:o,stringify:r}},function(t,e,n){"use strict";var r=n(113),o=n(8),i=n(14),a=n(51),s=n(18),u=n(114),c=n(259),l=n(115),f=Math.max,p=Math.min;r("replace",2,(function(t,e,n,r){var d=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,h=r.REPLACE_KEEPS_$0,v=d?"$":"$0";return[function(n,r){var o=s(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,r){if(!d&&h||"string"==typeof r&&-1===r.indexOf(v)){var s=n(e,t,this,r);if(s.done)return s.value}var m=o(t),g=String(this),y="function"==typeof r;y||(r=String(r));var b=m.global;if(b){var w=m.unicode;m.lastIndex=0}for(var x=[];;){var _=l(m,g);if(null===_)break;if(x.push(_),!b)break;""===String(_[0])&&(m.lastIndex=u(g,i(m.lastIndex),w))}for(var E,A="",k=0,C=0;C<x.length;C++){_=x[C];for(var D=String(_[0]),O=f(p(a(_.index),g.length),0),S=[],$=1;$<_.length;$++)S.push(void 0===(E=_[$])?E:String(E));var j=_.groups;if(y){var T=[D].concat(S,O,g);void 0!==j&&T.push(j);var P=String(r.apply(void 0,T))}else P=c(D,g,O,S,j,r);O>=k&&(A+=g.slice(k,O)+P,k=O+D.length)}return A+g.slice(k)}]}))},function(t,e,n){"use strict";var r=n(1),o=n(102).indexOf,i=n(44),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0,u=i("indexOf");r({target:"Array",proto:!0,forced:s||!u},{indexOf:function(t){return s?a.apply(this,arguments)||0:o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));n(84);var r=n(66);n(45),n(61),n(17),n(83),n(23),n(25),n(174);var o=n(91);function i(t){return function(t){if(Array.isArray(t))return Object(r.a)(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Object(o.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(2),o=n(33),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r,o,i=n(3),a=n(75),s=i.process,u=s&&s.versions,c=u&&u.v8;c?o=(r=c.split("."))[0]<4?1:r[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=r[1]),t.exports=o&&+o},function(t,e){t.exports={}},function(t,e){t.exports={}},function(t,e,n){var r=n(144),o=n(103).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(33);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,n){"use strict";var r=n(1),o=n(170);r({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},function(t,e,n){var r=n(3),o=n(164),i=n(170),a=n(22);for(var s in o){var u=r[s],c=u&&u.prototype;if(c&&c.forEach!==i)try{a(c,"forEach",i)}catch(t){c.forEach=i}}},function(t,e,n){"use strict";var r=n(1),o=n(7),i=n(3),a=n(11),s=n(5),u=n(10).f,c=n(147),l=i.Symbol;if(o&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var f={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof p?new l(t):void 0===t?l():l(t);return""===t&&(f[e]=!0),e};c(p,l);var d=p.prototype=l.prototype;d.constructor=p;var h=d.toString,v="Symbol(test)"==String(l("test")),m=/^Symbol\((.*)\)[^)]+$/;u(d,"description",{configurable:!0,get:function(){var t=s(this)?this.valueOf():this,e=h.call(t);if(a(f,t))return"";var n=v?e.slice(7,-1):e.replace(m,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:p})}},function(t,e,n){var r=n(26).Symbol;t.exports=r},function(t,e,n){var r=n(62),o=n(265),i=n(266),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return a}));n(20),n(49),n(198);var r=n(39);function o(t,e){return t=t.filter((function(n,r){var o=n.title,i=n.frontmatter,a=i.home,s=i.date,u=i.publish;if(t.indexOf(n)!==r)return!1;var c=!0===a||null==o||!1===u;return!0===e?!(c||void 0===s):!c}))}function i(t){t.sort((function(t,e){var n=t.frontmatter.sticky,o=e.frontmatter.sticky;return n&&o?n==o?Object(r.b)(t,e):n-o:n&&!o?-1:!n&&o?1:Object(r.b)(t,e)}))}function a(t){t.sort((function(t,e){return Object(r.b)(t,e)}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n(95);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return r}))},function(t,e,n){var r=n(1),o=n(3),i=n(75),a=[].slice,s=function(t){return function(e,n){var r=arguments.length>2,o=r?a.call(arguments,2):void 0;return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};r({global:!0,bind:!0,forced:/MSIE .\./.test(i)},{setTimeout:s(o.setTimeout),setInterval:s(o.setInterval)})},function(t,e,n){var r=n(15),o=Date.prototype,i=o.toString,a=o.getTime;new Date(NaN)+""!="Invalid Date"&&r(o,"toString",(function(){var t=a.call(this);return t==t?i.call(this):"Invalid Date"}))},function(t,e,n){var r=n(1),o=n(12),i=n(76);r({target:"Object",stat:!0,forced:n(2)((function(){i(1)}))},{keys:function(t){return i(o(t))}})},function(t,e,n){"use strict";var r=n(40),o=n(10),i=n(53);t.exports=function(t,e,n){var a=r(e);a in t?o.f(t,a,i(0,n)):t[a]=n}},function(t,e,n){var r=n(2),o=n(4),i=n(54),a=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return Y})),n.d(e,"c",(function(){return ot})),n.d(e,"d",(function(){return _})),n.d(e,"e",(function(){return G})),n.d(e,"f",(function(){return Q})),n.d(e,"g",(function(){return W})),n.d(e,"h",(function(){return I})),n.d(e,"i",(function(){return R}));var r=n(0);function o(t){return"function"==typeof t&&/native code/.test(t.toString())}var i="undefined"!=typeof Symbol&&o(Symbol)&&"undefined"!=typeof Reflect&&o(Reflect.ownKeys),a=function(t){return t},s={enumerable:!0,configurable:!0,get:a,set:a};function u(t,e,n){var r=n.get,o=n.set;s.get=r||a,s.set=o||a,Object.defineProperty(t,e,s)}function c(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function l(t,e){return Object.hasOwnProperty.call(t,e)}function f(t){return Array.isArray(t)}function p(t){return"[object Object]"===function(t){return Object.prototype.toString.call(t)}(t)}function d(t){return"function"==typeof t}function h(t,e){r.default.util.warn(t,e)}var v=void 0;try{var m=n(0);m&&w(m)?v=m:m&&"default"in m&&w(m.default)&&(v=m.default)}catch(t){}var g,y=null,b=null;function w(t){return t&&"function"==typeof t&&"Vue"===t.name}function x(){return y}function _(){return b}function E(t){b=t}function A(t){return _()}function k(t,e){void 0===e&&(e={});var n=t.config.silent;t.config.silent=!0;var r=new t(e);return t.config.silent=n,r}function C(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return t.$scopedSlots[e]?t.$scopedSlots[e].apply(t,n):h("slots."+e+'() got called outside of the "render()" scope',t)}}function D(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function O(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function S(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(O(arguments[e]));return t}function $(t){return i?Symbol.for(t):t}$("composition-api.preFlushQueue"),$("composition-api.postFlushQueue");var j="composition-api.refKey",T=new WeakMap,P=(new WeakMap,new WeakMap),B=function(t){u(this,"value",{get:t.get,set:t.set})};function F(t,e){var n=new B(t),r=Object.seal(n);return P.set(r,!0),r}function I(t){var e;if(M(t))return t;var n=W(((e={})[j]=t,e));return F({get:function(){return n[j]},set:function(t){return n[j]=t}})}function M(t){return t instanceof B}function R(t){if(!p(t))return t;var e={};for(var n in t)e[n]=L(t,n);return e}function L(t,e){var n=t[e];return M(n)?n:F({get:function(){return t[e]},set:function(n){return t[e]=n}})}function z(t){var e;return Boolean((null==t?void 0:t.__ob__)&&(null===(e=t.__ob__)||void 0===e?void 0:e.__raw__))}function N(t){var e;return Boolean((null==t?void 0:t.__ob__)&&!(null===(e=t.__ob__)||void 0===e?void 0:e.__raw__))}function U(t){if(!(!p(t)||z(t)||Array.isArray(t)||M(t)||(e=t,n=x(),n&&e instanceof n)||T.has(t))){var e,n;T.set(t,!0);for(var r=Object.keys(t),o=0;o<r.length;o++)V(t,r[o])}}function V(t,e,n){if("__ob__"!==e&&!z(t[e])){var r,o,i=Object.getOwnPropertyDescriptor(t,e);if(i){if(!1===i.configurable)return;r=i.get,o=i.set,r&&!o||2!==arguments.length||(n=t[e])}U(n),Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var o=r?r.call(t):n;return e!==j&&M(o)?o.value:o},set:function(i){if(!r||o){var a=r?r.call(t):n;e!==j&&M(a)&&!M(i)?a.value=i:o?o.call(t,i):n=i,U(i)}}})}}function H(t){var e,n=y||v;n.observable?e=n.observable(t):e=k(n,{data:{$$state:t}})._data.$$state;return l(e,"__ob__")||c(e,"__ob__",function(t){void 0===t&&(t={});return{value:t,dep:{notify:a,depend:a,addSub:a,removeSub:a}}}(e)),e}function q(){return H({}).__ob__}function W(t){if(!p(t)&&!f(t)||z(t)||!Object.isExtensible(t))return t;var e=H(t);return U(e),e}function J(t){return function(e){var n,r=A(((n=t)[0].toUpperCase(),n.slice(1)));r&&function(t,e,n,r){var o=e.$options,i=t.config.optionMergeStrategies[n];o[n]=i(o[n],function(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=_();E(t);try{return e.apply(void 0,S(n))}finally{E(o)}}}(e,r))}(x(),r,t,e)}}J("beforeMount");var G=J("mounted"),Q=(J("beforeUpdate"),J("updated"));J("beforeDestroy"),J("destroyed"),J("errorCaptured"),J("activated"),J("deactivated"),J("serverPrefetch");function Y(t){var e,n,r,o,i=_();if("function"==typeof t?e=t:(e=t.get,n=t.set),i&&!i.$isServer){var s,u=function(){if(!g){var t=k(x(),{computed:{value:function(){return 0}}}),e=t._computedWatchers.value.constructor,n=t._data.__ob__.dep.constructor;g={Watcher:e,Dep:n},t.$destroy()}return g}(),c=u.Watcher,l=u.Dep;o=function(){return s||(s=new c(i,e,a,{lazy:!0})),s.dirty&&s.evaluate(),l.target&&s.depend(),s.value},r=function(t){n&&n(t)}}else{var f=k(x(),{computed:{$$state:{get:e,set:n}}});i&&i.$on("hook:destroyed",(function(){return f.$destroy()})),o=function(){return f.$$state},r=function(t){f.$$state=t}}return F({get:o,set:r})}var K={set:function(t,e,n){(t.__composition_api_state__=t.__composition_api_state__||{})[e]=n},get:function(t,e){return(t.__composition_api_state__||{})[e]}};function Z(t){var e=K.get(t,"rawBindings")||{};if(e&&Object.keys(e).length){for(var n=t.$refs,r=K.get(t,"refs")||[],o=0;o<r.length;o++){var i=e[u=r[o]];!n[u]&&i&&M(i)&&(i.value=null)}var a=Object.keys(n),s=[];for(o=0;o<a.length;o++){var u;i=e[u=a[o]];n[u]&&i&&M(i)&&(i.value=n[u],s.push(u))}K.set(t,"refs",s)}}function X(t,e){var n=t.$options._parentVnode;if(n){for(var r=K.get(t,"slots")||[],o=function(t,e){var n;if(t){if(t._normalized)return t._normalized;for(var r in n={},t)t[r]&&"$"!==r[0]&&(n[r]=!0)}else n={};for(var r in e)r in n||(n[r]=!0);return n}(n.data.scopedSlots,t.$slots),i=0;i<r.length;i++){o[s=r[i]]||delete e[s]}var a=Object.keys(o);for(i=0;i<a.length;i++){var s;e[s=a[i]]||(e[s]=C(t,s))}K.set(t,"slots",a)}}function tt(t,e,n){var r=_();E(t);try{return e(t)}catch(t){if(!n)throw t;n(t)}finally{E(r)}}function et(t){t.mixin({beforeCreate:function(){var t=this,e=t.$options,n=e.setup,r=e.render;r&&(e.render=function(){for(var e=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return tt(t,(function(){return r.apply(e,n)}))});if(!n)return;if("function"!=typeof n)return void 0;var o=e.data;e.data=function(){return function(t,e){void 0===e&&(e={});var n,r=t.$options.setup,o=function(t){var e={slots:{}};["root","parent","refs","listeners","isServer","ssrContext"].forEach((function(n){var r="$"+n;u(e,n,{get:function(){return t[r]},set:function(){h("Cannot assign to '"+n+"' because it is a read-only property",t)}})})),["attrs"].forEach((function(n){var r="$"+n;u(e,n,{get:function(){var e,n,o=W({}),i=t[r],a=function(e){u(o,e,{get:function(){return t[r][e]}})};try{for(var s=D(Object.keys(i)),c=s.next();!c.done;c=s.next()){a(c.value)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return o},set:function(){h("Cannot assign to '"+n+"' because it is a read-only property",t)}})})),["emit"].forEach((function(n){var r="$"+n;u(e,n,{get:function(){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=t[r];o.apply(t,e)}}})})),!1;return e}(t);if(c(e,"__ob__",q()),X(t,o.slots),tt(t,(function(){n=r(e,o)})),!n)return;if(d(n)){var i=n;return void(t.$options.render=function(){return X(t,o.slots),tt(t,(function(){return i()}))})}if(p(n)){N(n)&&(n=R(n)),K.set(t,"rawBindings",n);var a=n;return void Object.keys(a).forEach((function(e){var n,r=a[e];M(r)||(N(r)?f(r)&&(r=I(r)):d(r)?r=r.bind(t):null===(n=r)||"object"!=typeof n?r=I(r):function t(e,n){void 0===n&&(n=new Map);if(n.has(e))return n.get(e);if(n.set(e,!1),Array.isArray(e)&&N(e))return n.set(e,!0),!0;if(!p(e)||z(e))return!1;return Object.keys(e).some((function(r){return t(e[r],n)}))}(r)&&function t(e){if(!p(e)||M(e)||N(e)||z(e))return;var n=x().util.defineReactive;Object.keys(e).forEach((function(r){var o=e[r];n(e,r,o),o&&t(o)}))}(r)),function(t,e,n){var r=t.$options.props;e in t||r&&l(r,e)||(M(n)?u(t,e,{get:function(){return n.value},set:function(t){n.value=t}}):t[e]=n)}(t,e,r)}))}0}(t,t.$props),"function"==typeof o?o.call(t,t):o||{}}},mounted:function(){Z(this)},updated:function(){Z(this)}})}function nt(t){(function(t){return l(t,"__composition_api_installed__")})(t)||(t.config.optionMergeStrategies.setup=function(t,e){return function(n,r){return function t(e,n){if(!e)return n;if(!n)return e;for(var r,o,a,s=i?Reflect.ownKeys(e):Object.keys(e),u=0;u<s.length;u++)"__ob__"!==(r=s[u])&&(o=n[r],a=e[r],l(n,r)?o!==a&&p(o)&&!M(o)&&p(a)&&!M(a)&&t(a,o):n[r]=a);return n}("function"==typeof t?t(n,r)||{}:void 0,"function"==typeof e?e(n,r)||{}:void 0)}},function(t){y=t,Object.defineProperty(t,"__composition_api_installed__",{configurable:!0,writable:!0,value:!0})}(t),et(t))}var rt={install:function(t){return nt(t)}};function ot(t){return t}"undefined"!=typeof window&&window.Vue&&window.Vue.use(rt),e.b=rt},function(t,e,n){var r=n(34),o=n(98);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.12.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++n+r).toString(36)}},function(t,e,n){var r=n(29);t.exports=r("navigator","userAgent")||""},function(t,e,n){var r=n(144),o=n(103);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(73),o=n(74),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e,n){var r=n(2),o=/#|\.prototype\./,i=function(t,e){var n=s[a(t)];return n==c||n!=u&&("function"==typeof e?r(e):!!e)},a=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},s=i.data={},u=i.NATIVE="N",c=i.POLYFILL="P";t.exports=i},function(t,e,n){var r=n(10).f,o=n(11),i=n(4)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(8),o=n(238);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return r(n),o(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},function(t,e,n){var r=n(31);t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var r=n(33),o=n(3);t.exports="process"==r(o.process)},function(t,e,n){n(173)("iterator")},function(t,e,n){n(1)({target:"Array",stat:!0},{isArray:n(58)})},function(t,e,n){"use strict";var r,o,i=n(111),a=n(112),s=n(73),u=RegExp.prototype.exec,c=s("native-string-replace",String.prototype.replace),l=u,f=(r=/a/,o=/b*/g,u.call(r,"a"),u.call(o,"a"),0!==r.lastIndex||0!==o.lastIndex),p=a.UNSUPPORTED_Y||a.BROKEN_CARET,d=void 0!==/()??/.exec("")[1];(f||d||p)&&(l=function(t){var e,n,r,o,a=this,s=p&&a.sticky,l=i.call(a),h=a.source,v=0,m=t;return s&&(-1===(l=l.replace("y","")).indexOf("g")&&(l+="g"),m=String(t).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==t[a.lastIndex-1])&&(h="(?: "+h+")",m=" "+m,v++),n=new RegExp("^(?:"+h+")",l)),d&&(n=new RegExp("^"+h+"$(?!\\s)",l)),f&&(e=a.lastIndex),r=u.call(s?n:a,m),s?r?(r.input=r.input.slice(v),r[0]=r[0].slice(v),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:f&&r&&(a.lastIndex=a.global?r.index+r[0].length:e),d&&r&&r.length>1&&c.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r}),t.exports=l},function(t,e,n){var r=n(270),o=n(271),i=n(272),a=n(273),s=n(274);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(180);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e,n){var r=n(35)(Object,"create");t.exports=r},function(t,e,n){var r=n(292);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(123);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n(32),n(17),n(96),n(174),n(23);var r=n(66);function o(t,e){if(t){if("string"==typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},function(t,e,n){var r,o; +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */void 0===(o="function"==typeof(r=function(){var t,e,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function o(t,e,n){return t<e?e:t>n?n:t}function i(t){return 100*(-1+t)}n.configure=function(t){var e,n;for(e in t)void 0!==(n=t[e])&&t.hasOwnProperty(e)&&(r[e]=n);return this},n.status=null,n.set=function(t){var e=n.isStarted();t=o(t,r.minimum,1),n.status=1===t?null:t;var u=n.render(!e),c=u.querySelector(r.barSelector),l=r.speed,f=r.easing;return u.offsetWidth,a((function(e){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,function(t,e,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+i(t)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+i(t)+"%,0)"}:{"margin-left":i(t)+"%"}).transition="all "+e+"ms "+n,o}(t,l,f)),1===t?(s(u,{transition:"none",opacity:1}),u.offsetWidth,setTimeout((function(){s(u,{transition:"all "+l+"ms linear",opacity:0}),setTimeout((function(){n.remove(),e()}),l)}),l)):setTimeout(e,l)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var t=function(){setTimeout((function(){n.status&&(n.trickle(),t())}),r.trickleSpeed)};return r.trickle&&t(),this},n.done=function(t){return t||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(t){var e=n.status;return e?("number"!=typeof t&&(t=(1-e)*o(Math.random()*e,.1,.95)),e=o(e+t,0,.994),n.set(e)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},t=0,e=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===e&&n.start(),t++,e++,r.always((function(){0==--e?(t=0,n.done()):n.set((t-e)/t)})),this):this},n.render=function(t){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var e=document.createElement("div");e.id="nprogress",e.innerHTML=r.template;var o,a=e.querySelector(r.barSelector),u=t?"-100":i(n.status||0),l=document.querySelector(r.parent);return s(a,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),r.showSpinner||(o=e.querySelector(r.spinnerSelector))&&p(o),l!=document.body&&c(l,"nprogress-custom-parent"),l.appendChild(e),e},n.remove=function(){l(document.documentElement,"nprogress-busy"),l(document.querySelector(r.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&p(t)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var a=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),s=function(){var t=["Webkit","O","Moz","ms"],e={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(t,e){return e.toUpperCase()})),e[n]||(e[n]=function(e){var n=document.body.style;if(e in n)return e;for(var r,o=t.length,i=e.charAt(0).toUpperCase()+e.slice(1);o--;)if((r=t[o]+i)in n)return r;return e}(n))}function r(t,e,r){e=n(e),t.style[e]=r}return function(t,e){var n,o,i=arguments;if(2==i.length)for(n in e)void 0!==(o=e[n])&&e.hasOwnProperty(n)&&r(t,n,o);else r(t,i[1],i[2])}}();function u(t,e){return("string"==typeof t?t:f(t)).indexOf(" "+e+" ")>=0}function c(t,e){var n=f(t),r=n+e;u(n,e)||(t.className=r.substring(1))}function l(t,e){var n,r=f(t);u(t,e)&&(n=r.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function f(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function p(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return n})?r.call(e,n,e,t):r)||(t.exports=o)},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));n(49),n(364),n(39);function r(){var t=["#e15b64","#f47e60","#f8b26a","#abbd81","#849b87","#e15b64","#f47e60","#f8b26a","#f26d6d","#67cc86","#fb9b5f","#3498db"];return t[Math.floor(Math.random()*t.length)]}function o(t){var e=t.__proto__.push;t.__proto__.push=function(t){return e.call(this,t).catch((function(t){return t}))}}function i(t){var e=t.getRoutes();t.beforeEach((function(t,n,r){var o=e.find((function(e){return e.regex.test(t.path)}));return/\.html$/.test(t.path)||o&&"*"!==o.path&&!o.redirect?r():decodeURIComponent(t.path)!==t.path?r(Object.assign({},t,{path:decodeURIComponent(t.path),fullPath:decodeURIComponent(t.fullPath)})):void r()}))}},function(t,e,n){"use strict";var r=n(1),o=n(43).some;r({target:"Array",proto:!0,forced:!n(44)("some")},{some:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(1),o=n(7);r({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperty:n(10).f})},function(t,e,n){var r=n(7),o=n(10).f,i=Function.prototype,a=i.toString,s=/^\s*function ([^ (]*)/;r&&!("name"in i)&&o(i,"name",{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(t){return""}}})},function(t,e,n){var r=n(4),o=n(41),i=n(10),a=r("unscopables"),s=Array.prototype;null==s[a]&&i.f(s,a,{configurable:!0,value:o(null)}),t.exports=function(t){s[a][t]=!0}},function(t,e,n){var r=n(3),o=n(99),i=r["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,e,n){var r=n(3),o=n(22);t.exports=function(t,e){try{o(r,t,e)}catch(n){r[t]=e}return e}},function(t,e,n){var r=n(3),o=n(5),i=r.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},function(t,e,n){var r=n(54),o=n(2);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){return!String(Symbol())||!Symbol.sham&&r&&r<41}))},function(t,e,n){var r=n(21),o=n(14),i=n(132),a=function(t){return function(e,n,a){var s,u=r(e),c=o(u.length),l=i(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){var r=n(98),o=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(t){return o.call(t)}),t.exports=r.inspectSource},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(11),o=n(12),i=n(77),a=n(150),s=i("IE_PROTO"),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=o(t),r(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,e,n){var r={};r[n(4)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){var r=n(8),o=n(31),i=n(4)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[i])?e:o(n)}},function(t,e,n){var r=n(5),o=n(33),i=n(4)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,n){"use strict";var r=n(8);t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";var r=n(2);function o(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=r((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=r((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},function(t,e,n){"use strict";n(38);var r=n(15),o=n(85),i=n(2),a=n(4),s=n(22),u=a("species"),c=RegExp.prototype,l=!i((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),f="$0"==="a".replace(/./,"$0"),p=a("replace"),d=!!/./[p]&&""===/./[p]("a","$0"),h=!i((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));t.exports=function(t,e,n,p){var v=a(t),m=!i((function(){var e={};return e[v]=function(){return 7},7!=""[t](e)})),g=m&&!i((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[v]=/./[v]),n.exec=function(){return e=!0,null},n[v](""),!e}));if(!m||!g||"replace"===t&&(!l||!f||d)||"split"===t&&!h){var y=/./[v],b=n(v,""[t],(function(t,e,n,r,i){var a=e.exec;return a===o||a===c.exec?m&&!i?{done:!0,value:y.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),{REPLACE_KEEPS_$0:f,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:d}),w=b[0],x=b[1];r(String.prototype,t,w),r(c,v,2==e?function(t,e){return x.call(t,this,e)}:function(t){return x.call(t,this)})}p&&s(c[v],"sham",!0)}},function(t,e,n){"use strict";var r=n(163).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){var r=n(33),o=n(85);t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==r(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},function(t,e,n){var r=n(264),o=n(46),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!s.call(t,"callee")};t.exports=u},function(t,e,n){var r=n(35)(n(26),"Map");t.exports=r},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(284),o=n(291),i=n(293),a=n(294),s=n(295);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(27),o=n(123),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;t.exports=function(t,e){if(r(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!o(t))||(a.test(t)||!i.test(t)||null!=e&&t in Object(e))}},function(t,e,n){var r=n(63),o=n(46);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){"use strict";var r=SyntaxError,o=Function,i=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(t){s=null}var u=function(){throw new i},c=s?function(){try{return u}catch(t){try{return s(arguments,"callee").get}catch(t){return u}}}():u,l=n(375)(),f=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?void 0:f(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":l?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?f(""[Symbol.iterator]()):void 0,"%Symbol%":l?Symbol:void 0,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=n(126),g=n(378),y=m.call(Function.call,Array.prototype.concat),b=m.call(Function.apply,Array.prototype.splice),w=m.call(Function.call,String.prototype.replace),x=m.call(Function.call,String.prototype.slice),_=m.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,k=function(t){var e=x(t,0,1),n=x(t,-1);if("%"===e&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var o=[];return w(t,E,(function(t,e,n,r){o[o.length]=n?w(r,A,"$1"):e||t})),o},C=function(t,e){var n,o=t;if(g(v,o)&&(o="%"+(n=v[o])[0]+"%"),g(h,o)){var s=h[o];if(s===p&&(s=function t(e){var n;if("%AsyncFunction%"===e)n=a("async function () {}");else if("%GeneratorFunction%"===e)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=a("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(n=f(o.prototype))}return h[e]=n,n}(o)),void 0===s&&!e)throw new i("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:s}}throw new r("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new i('"allowMissing" argument must be a boolean');if(null===_(/^%?[^%]*%?$/,t))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=k(t),o=n.length>0?n[0]:"",a=C("%"+o+"%",e),u=a.name,c=a.value,l=!1,f=a.alias;f&&(o=f[0],b(n,y([0,1],f)));for(var p=1,d=!0;p<n.length;p+=1){var v=n[p],m=x(v,0,1),w=x(v,-1);if(('"'===m||"'"===m||"`"===m||'"'===w||"'"===w||"`"===w)&&m!==w)throw new r("property names with quotes must have matching quotes");if("constructor"!==v&&d||(l=!0),g(h,u="%"+(o+="."+v)+"%"))c=h[u];else if(null!=c){if(!(v in c)){if(!e)throw new i("base intrinsic for "+t+" exists, but the property is not available.");return}if(s&&p+1>=n.length){var E=s(c,v);c=(d=!!E)&&"get"in E&&!("originalValue"in E.get)?E.get:c[v]}else d=g(c,v),c=c[v];d&&!l&&(h[u]=c)}}return c}},function(t,e,n){"use strict";var r=n(377);t.exports=Function.prototype.bind||r},function(t,e,n){"use strict";var r=String.prototype.replace,o=/%20/g,i="RFC1738",a="RFC3986";t.exports={default:a,formatters:{RFC1738:function(t){return r.call(t,o,"+")},RFC3986:function(t){return String(t)}},RFC1738:i,RFC3986:a}},function(t,e,n){var r=n(390);t.exports=function(t){return r(t,{weekStartsOn:1})}},function(t,e,n){"use strict";var r=n(13),o=n(402),i=n(208),a={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var u,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(u=n(209)),u),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(s(e,"application/json"),function(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,a=!n&&"json"===this.responseType;if(a||o&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(a){if("SyntaxError"===t.name)throw i(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(t){c.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){c.headers[t]=r.merge(a)})),t.exports=c},function(t,e,n){"use strict";n.d(e,"c",(function(){return i}));var r=n(0),o=n(72);function i(t){(t=t||r.default)&&!t.__composition_api_installed__&&r.default.use(o.b)}n.d(e,"a",(function(){return o.a})),n.d(e,"b",(function(){return o.c})),n.d(e,"d",(function(){return o.e})),n.d(e,"e",(function(){return o.f})),n.d(e,"f",(function(){return o.g})),n.d(e,"g",(function(){return o.h})),n.d(e,"h",(function(){return o.i})),i(r.default);r.default.version},function(t,e,n){"use strict";var r=n(1),o=n(2),i=n(58),a=n(5),s=n(12),u=n(14),c=n(70),l=n(133),f=n(71),p=n(4),d=n(54),h=p("isConcatSpreadable"),v=d>=51||!o((function(){var t=[];return t[h]=!1,t.concat()[0]!==t})),m=f("concat"),g=function(t){if(!a(t))return!1;var e=t[h];return void 0!==e?!!e:i(t)};r({target:"Array",proto:!0,forced:!v||!m},{concat:function(t){var e,n,r,o,i,a=s(this),f=l(a,0),p=0;for(e=-1,r=arguments.length;e<r;e++)if(g(i=-1===e?a:arguments[e])){if(p+(o=u(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,p++)n in i&&c(f,p,i[n])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");c(f,p++,i)}return f.length=p,f}})},function(t,e,n){var r=n(51),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},function(t,e,n){var r=n(5),o=n(58),i=n(4)("species");t.exports=function(t,e){var n;return o(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!o(n.prototype)?r(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n(45),n(61),n(17),n(83),n(23),n(25);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}},function(t,e,n){var r=n(18),o="["+n(136)+"]",i=RegExp("^"+o+o+"*"),a=RegExp(o+o+"*$"),s=function(t){return function(e){var n=String(r(e));return 1&t&&(n=n.replace(i,"")),2&t&&(n=n.replace(a,"")),n}};t.exports={start:s(1),end:s(2),trim:s(3)}},function(t,e){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));n(217),n(216),n(166);function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var o=n(225),i=n.n(o);function a(t,e){return!e||"object"!==i()(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=r(t);if(e){var i=r(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return a(this,n)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n(175),n(216);function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){"use strict";var r=n(21),o=n(97),i=n(56),a=n(42),s=n(146),u=a.set,c=a.getterFor("Array Iterator");t.exports=s(Array,"Array",(function(t,e){u(this,{type:"Array Iterator",target:r(t),index:0,kind:e})}),(function(){var t=c(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,e,n){var r=n(7),o=n(2),i=n(100);t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){var r=n(3);t.exports=r},function(t,e,n){var r=n(101);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){var r=n(7),o=n(10),i=n(8),a=n(76);t.exports=r?Object.defineProperties:function(t,e){i(t);for(var n,r=a(e),s=r.length,u=0;s>u;)o.f(t,n=r[u++],e[n]);return t}},function(t,e,n){var r=n(11),o=n(21),i=n(102).indexOf,a=n(55);t.exports=function(t,e){var n,s=o(t),u=0,c=[];for(n in s)!r(a,n)&&r(s,n)&&c.push(n);for(;e.length>u;)r(s,n=e[u++])&&(~i(c,n)||c.push(n));return c}},function(t,e,n){var r=n(29);t.exports=r("document","documentElement")},function(t,e,n){"use strict";var r=n(1),o=n(237),i=n(107),a=n(80),s=n(79),u=n(22),c=n(15),l=n(4),f=n(34),p=n(56),d=n(149),h=d.IteratorPrototype,v=d.BUGGY_SAFARI_ITERATORS,m=l("iterator"),g=function(){return this};t.exports=function(t,e,n,l,d,y,b){o(n,e,l);var w,x,_,E=function(t){if(t===d&&O)return O;if(!v&&t in C)return C[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},A=e+" Iterator",k=!1,C=t.prototype,D=C[m]||C["@@iterator"]||d&&C[d],O=!v&&D||E(d),S="Array"==e&&C.entries||D;if(S&&(w=i(S.call(new t)),h!==Object.prototype&&w.next&&(f||i(w)===h||(a?a(w,h):"function"!=typeof w[m]&&u(w,m,g)),s(w,A,!0,!0),f&&(p[A]=g))),"values"==d&&D&&"values"!==D.name&&(k=!0,O=function(){return D.call(this)}),f&&!b||C[m]===O||u(C,m,O),p[e]=O,d)if(x={values:E("values"),keys:y?O:E("keys"),entries:E("entries")},b)for(_ in x)(v||k||!(_ in C))&&c(C,_,x[_]);else r({target:e,proto:!0,forced:v||k},x);return x}},function(t,e,n){var r=n(11),o=n(148),i=n(30),a=n(10);t.exports=function(t,e){for(var n=o(e),s=a.f,u=i.f,c=0;c<n.length;c++){var l=n[c];r(t,l)||s(t,l,u(e,l))}}},function(t,e,n){var r=n(29),o=n(57),i=n(106),a=n(8);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(a(t)),n=i.f;return n?e.concat(n(t)):e}},function(t,e,n){"use strict";var r,o,i,a=n(2),s=n(107),u=n(22),c=n(11),l=n(4),f=n(34),p=l("iterator"),d=!1;[].keys&&("next"in(i=[].keys())?(o=s(s(i)))!==Object.prototype&&(r=o):d=!0);var h=null==r||a((function(){var t={};return r[p].call(t)!==t}));h&&(r={}),f&&!h||c(r,p)||u(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},function(t,e,n){var r=n(2);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,n){var r=n(3);t.exports=r.Promise},function(t,e,n){"use strict";var r=n(29),o=n(10),i=n(4),a=n(7),s=i("species");t.exports=function(t){var e=r(t),n=o.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(4),o=n(56),i=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},function(t,e,n){var r=n(155),o=n(56),i=n(4)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,e,n){var r=n(108),o=n(33),i=n(4)("toStringTag"),a="Arguments"==o(function(){return arguments}());t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:a?o(e):"Object"==(r=o(e))&&"function"==typeof e.callee?"Arguments":r}},function(t,e,n){var r=n(8);t.exports=function(t){var e=t.return;if(void 0!==e)return r(e.call(t)).value}},function(t,e,n){var r=n(4)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i={};i[r]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},function(t,e,n){var r,o,i,a=n(3),s=n(2),u=n(81),c=n(145),l=n(100),f=n(159),p=n(82),d=a.location,h=a.setImmediate,v=a.clearImmediate,m=a.process,g=a.MessageChannel,y=a.Dispatch,b=0,w={},x=function(t){if(w.hasOwnProperty(t)){var e=w[t];delete w[t],e()}},_=function(t){return function(){x(t)}},E=function(t){x(t.data)},A=function(t){a.postMessage(t+"",d.protocol+"//"+d.host)};h&&v||(h=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return w[++b]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(b),b},v=function(t){delete w[t]},p?r=function(t){m.nextTick(_(t))}:y&&y.now?r=function(t){y.now(_(t))}:g&&!f?(i=(o=new g).port2,o.port1.onmessage=E,r=u(i.postMessage,i,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts&&d&&"file:"!==d.protocol&&!s(A)?(r=A,a.addEventListener("message",E,!1)):r="onreadystatechange"in l("script")?function(t){c.appendChild(l("script")).onreadystatechange=function(){c.removeChild(this),x(t)}}:function(t){setTimeout(_(t),0)}),t.exports={set:h,clear:v}},function(t,e,n){var r=n(75);t.exports=/(?:iphone|ipod|ipad).*applewebkit/i.test(r)},function(t,e,n){var r=n(8),o=n(5),i=n(161);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var r=n(31),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),a=new E(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return k()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,a),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function f(){}function p(){}function d(){}var h={};s(h,o,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(A([])));m&&m!==e&&n.call(m,o)&&(h=m);var g=d.prototype=f.prototype=Object.create(h);function y(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){var r;this._invoke=function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,s){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}}function w(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function A(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=d,s(g,"constructor",d),s(d,"constructor",p),p.displayName=s(d,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},y(b.prototype),s(b.prototype,i,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new b(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(g),s(g,a,"Generator"),s(g,o,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=A,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:A(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){var r=n(51),o=n(18),i=function(t){return function(e,n){var i,a,s=String(o(e)),u=r(n),c=s.length;return u<0||u>=c?t?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):i:t?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){var r=n(1),o=n(7),i=n(148),a=n(21),s=n(30),u=n(70);r({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){for(var e,n,r=a(t),o=s.f,c=i(r),l={},f=0;c.length>f;)void 0!==(n=o(r,e=c[f++]))&&u(l,e,n);return l}})},function(t,e,n){var r=n(1),o=n(2),i=n(12),a=n(107),s=n(150);r({target:"Object",stat:!0,forced:o((function(){a(1)})),sham:!s},{getPrototypeOf:function(t){return a(i(t))}})},function(t,e,n){"use strict";var r=n(1),o=n(252).left,i=n(44),a=n(54),s=n(82);r({target:"Array",proto:!0,forced:!i("reduce")||!s&&a>79&&a<83},{reduce:function(t){return o(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(110);t.exports=function(t){if(r(t))throw TypeError("The method doesn't accept regular expressions");return t}},function(t,e,n){var r=n(4)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(t){}}return!1}},function(t,e,n){"use strict";var r=n(43).forEach,o=n(44)("forEach");t.exports=o?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},function(t,e,n){var r=n(2);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(t,e,n){var r=n(4);e.f=r},function(t,e,n){var r=n(141),o=n(11),i=n(172),a=n(10).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});o(e,t)||a(e,t,{value:i.f(t)})}},function(t,e,n){var r=n(1),o=n(257);r({target:"Array",stat:!0,forced:!n(157)((function(t){Array.from(t)}))},{from:o})},function(t,e,n){n(1)({target:"Object",stat:!0,sham:!n(7)},{create:n(41)})},function(t,e,n){"use strict";var r=n(1),o=n(52),i=n(21),a=n(44),s=[].join,u=o!=Object,c=a("join",",");r({target:"Array",proto:!0,forced:u||!c},{join:function(t){return s.call(i(this),void 0===t?",":t)}})},function(t,e){t.exports=function(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}},function(t,e){var n="object"==typeof global&&global&&global.Object===Object&&global;t.exports=n},function(t,e,n){var r=n(86),o=n(275),i=n(276),a=n(277),s=n(278),u=n(279);function c(t){var e=this.__data__=new r(t);this.size=e.size}c.prototype.clear=o,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=s,c.prototype.set=u,t.exports=c},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(63),o=n(118);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var r=n(296),o=n(46);t.exports=function t(e,n,i,a,s){return e===n||(null==e||null==n||!o(e)&&!o(n)?e!=e&&n!=n:r(e,n,i,a,t,s))}},function(t,e,n){var r=n(185),o=n(299),i=n(186);t.exports=function(t,e,n,a,s,u){var c=1&n,l=t.length,f=e.length;if(l!=f&&!(c&&f>l))return!1;var p=u.get(t),d=u.get(e);if(p&&d)return p==e&&d==t;var h=-1,v=!0,m=2&n?new r:void 0;for(u.set(t,e),u.set(e,t);++h<l;){var g=t[h],y=e[h];if(a)var b=c?a(y,g,h,e,t,u):a(g,y,h,t,e,u);if(void 0!==b){if(b)continue;v=!1;break}if(m){if(!o(e,(function(t,e){if(!i(m,e)&&(g===t||s(g,t,n,a,u)))return m.push(e)}))){v=!1;break}}else if(g!==y&&!s(g,y,n,a,u)){v=!1;break}}return u.delete(t),u.delete(e),v}},function(t,e,n){var r=n(119),o=n(297),i=n(298);function a(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new r;++e<n;)this.add(t[e])}a.prototype.add=a.prototype.push=o,a.prototype.has=i,t.exports=a},function(t,e){t.exports=function(t,e){return t.has(e)}},function(t,e,n){var r=n(309),o=n(315),i=n(192);t.exports=function(t){return i(t)?r(t):o(t)}},function(t,e,n){(function(t){var r=n(26),o=n(311),i=e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===i?r.Buffer:void 0,u=(s?s.isBuffer:void 0)||o;t.exports=u}).call(this,n(189)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,n){var r=n(312),o=n(313),i=n(314),a=i&&i.isTypedArray,s=a?o(a):r;t.exports=s},function(t,e,n){var r=n(181),o=n(121);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,e,n){var r=n(35)(n(26),"Set");t.exports=r},function(t,e,n){var r=n(118);t.exports=function(t){return t==t&&!r(t)}},function(t,e){t.exports=function(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}},function(t,e,n){var r=n(197),o=n(90);t.exports=function(t,e){for(var n=0,i=(e=r(e,t)).length;null!=t&&n<i;)t=t[o(e[n++])];return n&&n==i?t:void 0}},function(t,e,n){var r=n(27),o=n(122),i=n(326),a=n(329);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},function(t,e,n){"use strict";var r=n(1),o=n(31),i=n(12),a=n(2),s=n(44),u=[],c=u.sort,l=a((function(){u.sort(void 0)})),f=a((function(){u.sort(null)})),p=s("sort");r({target:"Array",proto:!0,forced:l||!f||!p},{sort:function(t){return void 0===t?c.call(i(this)):c.call(i(this),o(t))}})},function(t,e,n){var r=n(5),o=n(80);t.exports=function(t,e,n){var i,a;return o&&"function"==typeof(i=e.constructor)&&i!==n&&r(a=i.prototype)&&a!==n.prototype&&o(t,a),t}},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";var r=n(127),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),s=function(t,e){for(var n=e&&e.plainObjects?Object.create(null):{},r=0;r<t.length;++r)void 0!==t[r]&&(n[r]=t[r]);return n};t.exports={arrayToObject:s,assign:function(t,e){return Object.keys(e).reduce((function(t,n){return t[n]=e[n],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],n=[],r=0;r<e.length;++r)for(var o=e[r],a=o.obj[o.prop],s=Object.keys(a),u=0;u<s.length;++u){var c=s[u],l=a[c];"object"==typeof l&&null!==l&&-1===n.indexOf(l)&&(e.push({obj:a,prop:c}),n.push(l))}return function(t){for(;t.length>1;){var e=t.pop(),n=e.obj[e.prop];if(i(n)){for(var r=[],o=0;o<n.length;++o)void 0!==n[o]&&r.push(n[o]);e.obj[e.prop]=r}}}(e),t},decode:function(t,e,n){var r=t.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(t){return r}},encode:function(t,e,n,o,i){if(0===t.length)return t;var s=t;if("symbol"==typeof t?s=Symbol.prototype.toString.call(t):"string"!=typeof t&&(s=String(t)),"iso-8859-1"===n)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var u="",c=0;c<s.length;++c){var l=s.charCodeAt(c);45===l||46===l||95===l||126===l||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||i===r.RFC1738&&(40===l||41===l)?u+=s.charAt(c):l<128?u+=a[l]:l<2048?u+=a[192|l>>6]+a[128|63&l]:l<55296||l>=57344?u+=a[224|l>>12]+a[128|l>>6&63]+a[128|63&l]:(c+=1,l=65536+((1023&l)<<10|1023&s.charCodeAt(c)),u+=a[240|l>>18]+a[128|l>>12&63]+a[128|l>>6&63]+a[128|63&l])}return u},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(i(t)){for(var n=[],r=0;r<t.length;r+=1)n.push(e(t[r]));return n}return e(t)},merge:function t(e,n,r){if(!n)return e;if("object"!=typeof n){if(i(e))e.push(n);else{if(!e||"object"!=typeof e)return[e,n];(r&&(r.plainObjects||r.allowPrototypes)||!o.call(Object.prototype,n))&&(e[n]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(n);var a=e;return i(e)&&!i(n)&&(a=s(e,r)),i(e)&&i(n)?(n.forEach((function(n,i){if(o.call(e,i)){var a=e[i];a&&"object"==typeof a&&n&&"object"==typeof n?e[i]=t(a,n,r):e.push(n)}else e[i]=n})),e):Object.keys(n).reduce((function(e,i){var a=n[i];return o.call(e,i)?e[i]=t(e[i],a,r):e[i]=a,e}),a)}}},function(t,e){t.exports=function(t){return t instanceof Date}},function(t,e,n){var r=n(36),o=n(128);t.exports=function(t){var e=r(t),n=e.getFullYear(),i=new Date(0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var a=o(i),s=new Date(0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);var u=o(s);return e.getTime()>=a.getTime()?n+1:e.getTime()>=u.getTime()?n:n-1}},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(13);function o(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var a=[];r.forEach(e,(function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,(function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(o(e)+"="+o(t))})))})),i=a.join("&")}if(i){var s=t.indexOf("#");-1!==s&&(t=t.slice(0,s)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}},function(t,e,n){"use strict";var r=n(13),o=n(403),i=n(404),a=n(207),s=n(405),u=n(408),c=n(409),l=n(210);t.exports=function(t){return new Promise((function(e,n){var f=t.data,p=t.headers,d=t.responseType;r.isFormData(f)&&delete p["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var v=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";p.Authorization="Basic "+btoa(v+":"+m)}var g=s(t.baseURL,t.url);function y(){if(h){var r="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,i={data:d&&"text"!==d&&"json"!==d?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:t,request:h};o(e,n,i),h=null}}if(h.open(t.method.toUpperCase(),a(g,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(n(l("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){n(l("Network Error",t,null,h)),h=null},h.ontimeout=function(){var e="timeout of "+t.timeout+"ms exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(l(e,t,t.transitional&&t.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var b=(t.withCredentials||c(g))&&t.xsrfCookieName?i.read(t.xsrfCookieName):void 0;b&&(p[t.xsrfHeaderName]=b)}"setRequestHeader"in h&&r.forEach(p,(function(t,e){void 0===f&&"content-type"===e.toLowerCase()?delete p[e]:h.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),d&&"json"!==d&&(h.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){h&&(h.abort(),n(t),h=null)})),f||(f=null),h.send(f)}))}},function(t,e,n){"use strict";var r=n(208);t.exports=function(t,e,n,o,i){var a=new Error(t);return r(a,e,n,o,i)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e){e=e||{};var n={},o=["url","method","data"],i=["headers","auth","proxy","params"],a=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function u(t,e){return r.isPlainObject(t)&&r.isPlainObject(e)?r.merge(t,e):r.isPlainObject(e)?r.merge({},e):r.isArray(e)?e.slice():e}function c(o){r.isUndefined(e[o])?r.isUndefined(t[o])||(n[o]=u(void 0,t[o])):n[o]=u(t[o],e[o])}r.forEach(o,(function(t){r.isUndefined(e[t])||(n[t]=u(void 0,e[t]))})),r.forEach(i,c),r.forEach(a,(function(o){r.isUndefined(e[o])?r.isUndefined(t[o])||(n[o]=u(void 0,t[o])):n[o]=u(void 0,e[o])})),r.forEach(s,(function(r){r in e?n[r]=u(t[r],e[r]):r in t&&(n[r]=u(void 0,t[r]))}));var l=o.concat(i).concat(a).concat(s),f=Object.keys(t).concat(Object.keys(e)).filter((function(t){return-1===l.indexOf(t)}));return r.forEach(f,c),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){},function(t,e,n){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",o="minute",i="hour",a="day",s="week",u="month",c="quarter",l="year",f="date",p="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),o=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(o,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),o=e.clone().add(r,u),i=n-o<0,a=e.clone().add(r+(i?-1:1),u);return+(-(r+(n-o)/(i?o-a:a-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:l,w:s,d:a,D:f,h:i,m:o,s:r,ms:n,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",b={};b[y]=v;var w=function(t){return t instanceof A},x=function(t,e,n){var r;if(!t)return y;if("string"==typeof t)b[t]&&(r=t),e&&(b[t]=e,r=t);else{var o=t.name;b[o]=t,r=o}return!n&&r&&(y=r),r||!n&&y},_=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new A(n)},E=g;E.l=x,E.i=w,E.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var A=function(){function v(t){this.$L=x(t.locale,null,!0),this.parse(t)}var m=v.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(E.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(d);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return E},m.isValid=function(){return!(this.$d.toString()===p)},m.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return _(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<_(t)},m.$g=function(t,e,n){return E.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,c=!!E.u(e)||e,p=E.p(t),d=function(t,e){var r=E.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return c?r:r.endOf(a)},h=function(t,e){return E.w(n.toDate()[t].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},v=this.$W,m=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(p){case l:return c?d(1,0):d(31,11);case u:return c?d(1,m):d(0,m+1);case s:var b=this.$locale().weekStart||0,w=(v<b?v+7:v)-b;return d(c?g-w:g+(6-w),m);case a:case f:return h(y+"Hours",0);case i:return h(y+"Minutes",1);case o:return h(y+"Seconds",2);case r:return h(y+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var s,c=E.p(t),p="set"+(this.$u?"UTC":""),d=(s={},s[a]=p+"Date",s[f]=p+"Date",s[u]=p+"Month",s[l]=p+"FullYear",s[i]=p+"Hours",s[o]=p+"Minutes",s[r]=p+"Seconds",s[n]=p+"Milliseconds",s)[c],h=c===a?this.$D+(e-this.$W):e;if(c===u||c===l){var v=this.clone().set(f,1);v.$d[d](h),v.init(),this.$d=v.set(f,Math.min(this.$D,v.daysInMonth())).$d}else d&&this.$d[d](h);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[E.p(t)]()},m.add=function(n,c){var f,p=this;n=Number(n);var d=E.p(c),h=function(t){var e=_(p);return E.w(e.date(e.date()+Math.round(t*n)),p)};if(d===u)return this.set(u,this.$M+n);if(d===l)return this.set(l,this.$y+n);if(d===a)return h(1);if(d===s)return h(7);var v=(f={},f[o]=t,f[i]=e,f[r]=1e3,f)[d]||1,m=this.$d.getTime()+n*v;return E.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=t||"YYYY-MM-DDTHH:mm:ssZ",o=E.z(this),i=this.$H,a=this.$m,s=this.$M,u=n.weekdays,c=n.months,l=function(t,n,o,i){return t&&(t[n]||t(e,r))||o[n].substr(0,i)},f=function(t){return E.s(i%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},v={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:E.s(s+1,2,"0"),MMM:l(n.monthsShort,s,c,3),MMMM:l(c,s),D:this.$D,DD:E.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,u,2),ddd:l(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(i),HH:E.s(i,2,"0"),h:f(1),hh:f(2),a:d(i,a,!0),A:d(i,a,!1),m:String(a),mm:E.s(a,2,"0"),s:String(this.$s),ss:E.s(this.$s,2,"0"),SSS:E.s(this.$ms,3,"0"),Z:o};return r.replace(h,(function(t,e){return e||v[t]||o.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,f,p){var d,h=E.p(f),v=_(n),m=(v.utcOffset()-this.utcOffset())*t,g=this-v,y=E.m(this,v);return y=(d={},d[l]=y/12,d[u]=y,d[c]=y/3,d[s]=(g-m)/6048e5,d[a]=(g-m)/864e5,d[i]=g/e,d[o]=g/t,d[r]=g/1e3,d)[h]||g,p?y:E.a(y)},m.daysInMonth=function(){return this.endOf(u).$D},m.$locale=function(){return b[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=x(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return E.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},v}(),k=A.prototype;return _.prototype=k,[["$ms",n],["$s",r],["$m",o],["$H",i],["$W",a],["$M",u],["$y",l],["$D",f]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),_.extend=function(t,e){return t.$i||(t(e,A,_),t.$i=!0),_},_.locale=x,_.isDayjs=w,_.unix=function(t){return _(1e3*t)},_.en=b[y],_.Ls=b,_.p={},_}()},function(t,e,n){n(1)({target:"Object",stat:!0},{setPrototypeOf:n(80)})},function(t,e,n){var r=n(1),o=n(29),i=n(31),a=n(8),s=n(5),u=n(41),c=n(234),l=n(2),f=o("Reflect","construct"),p=l((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),d=!l((function(){f((function(){}))})),h=p||d;r({target:"Reflect",stat:!0,forced:h,sham:h},{construct:function(t,e){i(t),a(e);var n=arguments.length<3?t:i(arguments[2]);if(d&&!p)return f(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return r.push.apply(r,e),new(c.apply(t,r))}var o=n.prototype,l=u(s(o)?o:Object.prototype),h=Function.apply.call(t,l,e);return s(h)?h:l}})},function(t,e,n){},function(t,e,n){},function(t,e,n){var r=n(262),o=n(267),i=n(338),a=n(346),s=n(355),u=n(356),c=i((function(t){var e=u(t);return s(e)&&(e=void 0),a(r(t,1,s,!0),o(e,2))}));t.exports=c},function(t,e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,s="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,c=s||u||Function("return this")(),l=Object.prototype.toString,f=Math.max,p=Math.min,d=function(){return c.Date.now()};function h(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==l.call(t)}(t))return NaN;if(h(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=h(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var s=o.test(t);return s||i.test(t)?a(t.slice(2),s?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r,o,i,a,s,u,c=0,l=!1,m=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=r,i=o;return r=o=void 0,c=e,a=t.apply(i,n)}function b(t){return c=t,s=setTimeout(x,e),l?y(t):a}function w(t){var n=t-u;return void 0===u||n>=e||n<0||m&&t-c>=i}function x(){var t=d();if(w(t))return _(t);s=setTimeout(x,function(t){var n=e-(t-u);return m?p(n,i-(t-c)):n}(t))}function _(t){return s=void 0,g&&r?y(t):(r=o=void 0,a)}function E(){var t=d(),n=w(t);if(r=arguments,o=this,u=t,n){if(void 0===s)return b(u);if(m)return s=setTimeout(x,e),y(u)}return void 0===s&&(s=setTimeout(x,e)),a}return e=v(e)||0,h(n)&&(l=!!n.leading,i=(m="maxWait"in n)?f(v(n.maxWait)||0,e):i,g="trailing"in n?!!n.trailing:g),E.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=o=s=void 0},E.flush=function(){return void 0===s?a:_(d())},E}},function(t,e,n){!function(){"use strict";t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var n,r=t.HTMLElement||t.Element,o={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},i=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,a=(n=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?h.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):o.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?o.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var t=arguments[0].left,e=arguments[0].top;h.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):o.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var n=p(this),r=n.getBoundingClientRect(),i=this.getBoundingClientRect();n!==e.body?(h.call(this,n,n.scrollLeft+i.left-r.left,n.scrollTop+i.top-r.top),"fixed"!==t.getComputedStyle(n).position&&t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):t.scrollBy({left:i.left,top:i.top,behavior:"smooth"})}else o.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(t,e){this.scrollLeft=t,this.scrollTop=e}function u(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(t,e){return"Y"===e?t.clientHeight+a<t.scrollHeight:"X"===e?t.clientWidth+a<t.scrollWidth:void 0}function l(e,n){var r=t.getComputedStyle(e,null)["overflow"+n];return"auto"===r||"scroll"===r}function f(t){var e=c(t,"Y")&&l(t,"Y"),n=c(t,"X")&&l(t,"X");return e||n}function p(t){for(;t!==e.body&&!1===f(t);)t=t.parentNode||t.host;return t}function d(e){var n,r,o,a,s=(i()-e.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=e.startX+(e.x-e.startX)*n,o=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,r,o),r===e.x&&o===e.y||t.requestAnimationFrame(d.bind(t,e))}function h(n,r,a){var u,c,l,f,p=i();n===e.body?(u=t,c=t.scrollX||t.pageXOffset,l=t.scrollY||t.pageYOffset,f=o.scroll):(u=n,c=n.scrollLeft,l=n.scrollTop,f=s),d({scrollable:u,method:f,startTime:p,startX:c,startY:l,x:r,y:a})}}}}()},function(t,e,n){var r=n(384),o=n(389),i=n(205),a=n(36),s=n(392),u=n(393);var c={M:function(t){return t.getMonth()+1},MM:function(t){return p(t.getMonth()+1,2)},Q:function(t){return Math.ceil((t.getMonth()+1)/3)},D:function(t){return t.getDate()},DD:function(t){return p(t.getDate(),2)},DDD:function(t){return r(t)},DDDD:function(t){return p(r(t),3)},d:function(t){return t.getDay()},E:function(t){return t.getDay()||7},W:function(t){return o(t)},WW:function(t){return p(o(t),2)},YY:function(t){return p(t.getFullYear(),4).substr(2)},YYYY:function(t){return p(t.getFullYear(),4)},GG:function(t){return String(i(t)).substr(2)},GGGG:function(t){return i(t)},H:function(t){return t.getHours()},HH:function(t){return p(t.getHours(),2)},h:function(t){var e=t.getHours();return 0===e?12:e>12?e%12:e},hh:function(t){return p(c.h(t),2)},m:function(t){return t.getMinutes()},mm:function(t){return p(t.getMinutes(),2)},s:function(t){return t.getSeconds()},ss:function(t){return p(t.getSeconds(),2)},S:function(t){return Math.floor(t.getMilliseconds()/100)},SS:function(t){return p(Math.floor(t.getMilliseconds()/10),2)},SSS:function(t){return p(t.getMilliseconds(),3)},Z:function(t){return f(t.getTimezoneOffset(),":")},ZZ:function(t){return f(t.getTimezoneOffset())},X:function(t){return Math.floor(t.getTime()/1e3)},x:function(t){return t.getTime()}};function l(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|]$/g,""):t.replace(/\\/g,"")}function f(t,e){e=e||"";var n=t>0?"-":"+",r=Math.abs(t),o=r%60;return n+p(Math.floor(r/60),2)+e+p(o,2)}function p(t,e){for(var n=Math.abs(t).toString();n.length<e;)n="0"+n;return n}t.exports=function(t,e,n){var r=e?String(e):"YYYY-MM-DDTHH:mm:ss.SSSZ",o=(n||{}).locale,i=u.format.formatters,f=u.format.formattingTokensRegExp;o&&o.format&&o.format.formatters&&(i=o.format.formatters,o.format.formattingTokensRegExp&&(f=o.format.formattingTokensRegExp));var p=a(t);return s(p)?function(t,e,n){var r,o,i=t.match(n),a=i.length;for(r=0;r<a;r++)o=e[i[r]]||c[i[r]],i[r]=o||l(i[r]);return function(t){for(var e="",n=0;n<a;n++)i[n]instanceof Function?e+=i[n](t,c):e+=i[n];return e}}(r,i,f)(p):"Invalid Date"}},function(t,e,n){function r(){var t;try{t=e.storage.debug}catch(t){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t}(e=t.exports=n(418)).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),!n)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))})),t.splice(i,0,r)},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}},e.load=r,e.useColors=function(){if("undefined"!=typeof window&&window.process&&"renderer"===window.process.type)return!0;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(t){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(r())},function(t,e,n){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=r=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),r(e)}n(45),n(61),n(17),n(83),n(23),n(25),t.exports=r,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var r=n(1),o=n(369);r({global:!0,forced:parseInt!=o},{parseInt:o})},function(t,e,n){var r=n(1),o=n(2),i=n(21),a=n(30).f,s=n(7),u=o((function(){a(1)}));r({target:"Object",stat:!0,forced:!s||u,sham:!s},{getOwnPropertyDescriptor:function(t,e){return a(i(t),e)}})},function(t,e,n){"use strict";var r=n(1),o=n(2),i=n(12),a=n(40);r({target:"Date",proto:!0,forced:o((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=i(this),n=a(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},function(t,e,n){"use strict";n(1)({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},function(t,e,n){var r=n(1),o=n(359);r({target:"Date",proto:!0,forced:Date.prototype.toISOString!==o},{toISOString:o})},function(t,e,n){"use strict";var r=n(113),o=n(8),i=n(14),a=n(18),s=n(114),u=n(115);r("match",1,(function(t,e,n){return[function(e){var n=a(this),r=null==e?void 0:e[t];return void 0!==r?r.call(e,n):new RegExp(e)[t](String(n))},function(t){var r=n(e,t,this);if(r.done)return r.value;var a=o(t),c=String(this);if(!a.global)return u(a,c);var l=a.unicode;a.lastIndex=0;for(var f,p=[],d=0;null!==(f=u(a,c));){var h=String(f[0]);p[d]=h,""===h&&(a.lastIndex=s(c,i(a.lastIndex),l)),d++}return 0===d?null:p}]}))},function(t,e,n){var r=n(7),o=n(3),i=n(78),a=n(199),s=n(10).f,u=n(57).f,c=n(110),l=n(111),f=n(112),p=n(15),d=n(2),h=n(42).enforce,v=n(152),m=n(4)("match"),g=o.RegExp,y=g.prototype,b=/a/g,w=/a/g,x=new g(b)!==b,_=f.UNSUPPORTED_Y;if(r&&i("RegExp",!x||_||d((function(){return w[m]=!1,g(b)!=b||g(w)==w||"/a/i"!=g(b,"i")})))){for(var E=function(t,e){var n,r=this instanceof E,o=c(t),i=void 0===e;if(!r&&o&&t.constructor===E&&i)return t;x?o&&!i&&(t=t.source):t instanceof E&&(i&&(e=l.call(t)),t=t.source),_&&(n=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var s=a(x?new g(t,e):g(t,e),r?this:y,E);_&&n&&(h(s).sticky=!0);return s},A=function(t){t in E||s(E,t,{configurable:!0,get:function(){return g[t]},set:function(e){g[t]=e}})},k=u(g),C=0;k.length>C;)A(k[C++]);y.constructor=E,E.prototype=y,p(o,"RegExp",E)}v("RegExp")},function(t,e,n){"use strict";var r=n(15),o=n(8),i=n(2),a=n(111),s=RegExp.prototype,u=s.toString,c=i((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),l="toString"!=u.name;(c||l)&&r(RegExp.prototype,"toString",(function(){var t=o(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in s)?a.call(t):n)}),{unsafe:!0})},function(t,e,n){"use strict";var r=n(31),o=n(5),i=[].slice,a={},s=function(t,e,n){if(!(e in a)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";a[e]=Function("C,a","return new C("+r.join(",")+")")}return a[e](t,n)};t.exports=Function.bind||function(t){var e=r(this),n=i.call(arguments,1),a=function(){var r=n.concat(i.call(arguments));return this instanceof a?s(e,r.length,r):e.apply(t,r)};return o(e.prototype)&&(a.prototype=e.prototype),a}},function(t,e,n){t.exports=n(422)},function(t,e,n){var r=n(3),o=n(104),i=r.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,e,n){"use strict";var r=n(149).IteratorPrototype,o=n(41),i=n(53),a=n(79),s=n(56),u=function(){return this};t.exports=function(t,e,n){var c=e+" Iterator";return t.prototype=o(r,{next:i(1,n)}),a(t,c,!1,!0),s[c]=u,t}},function(t,e,n){var r=n(5);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,n){"use strict";var r,o,i,a,s=n(1),u=n(34),c=n(3),l=n(29),f=n(151),p=n(15),d=n(240),h=n(80),v=n(79),m=n(152),g=n(5),y=n(31),b=n(241),w=n(104),x=n(242),_=n(157),E=n(109),A=n(158).set,k=n(243),C=n(160),D=n(245),O=n(161),S=n(246),$=n(42),j=n(78),T=n(4),P=n(247),B=n(82),F=n(54),I=T("species"),M="Promise",R=$.get,L=$.set,z=$.getterFor(M),N=f&&f.prototype,U=f,V=N,H=c.TypeError,q=c.document,W=c.process,J=O.f,G=J,Q=!!(q&&q.createEvent&&c.dispatchEvent),Y="function"==typeof PromiseRejectionEvent,K=!1,Z=j(M,(function(){var t=w(U)!==String(U);if(!t&&66===F)return!0;if(u&&!V.finally)return!0;if(F>=51&&/native code/.test(U))return!1;var e=new U((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(e.constructor={})[I]=n,!(K=e.then((function(){}))instanceof n)||!t&&P&&!Y})),X=Z||!_((function(t){U.all(t).catch((function(){}))})),tt=function(t){var e;return!(!g(t)||"function"!=typeof(e=t.then))&&e},et=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;k((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var a,s,u,c=n[i++],l=o?c.ok:c.fail,f=c.resolve,p=c.reject,d=c.domain;try{l?(o||(2===t.rejection&&it(t),t.rejection=1),!0===l?a=r:(d&&d.enter(),a=l(r),d&&(d.exit(),u=!0)),a===c.promise?p(H("Promise-chain cycle")):(s=tt(a))?s.call(a,f,p):f(a)):p(r)}catch(t){d&&!u&&d.exit(),p(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&rt(t)}))}},nt=function(t,e,n){var r,o;Q?((r=q.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},!Y&&(o=c["on"+t])?o(r):"unhandledrejection"===t&&D("Unhandled promise rejection",n)},rt=function(t){A.call(c,(function(){var e,n=t.facade,r=t.value;if(ot(t)&&(e=S((function(){B?W.emit("unhandledRejection",r,n):nt("unhandledrejection",n,r)})),t.rejection=B||ot(t)?2:1,e.error))throw e.value}))},ot=function(t){return 1!==t.rejection&&!t.parent},it=function(t){A.call(c,(function(){var e=t.facade;B?W.emit("rejectionHandled",e):nt("rejectionhandled",e,t.value)}))},at=function(t,e,n){return function(r){t(e,r,n)}},st=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,et(t,!0))},ut=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw H("Promise can't be resolved itself");var r=tt(e);r?k((function(){var n={done:!1};try{r.call(e,at(ut,n,t),at(st,n,t))}catch(e){st(n,e,t)}})):(t.value=e,t.state=1,et(t,!1))}catch(e){st({done:!1},e,t)}}};if(Z&&(V=(U=function(t){b(this,U,M),y(t),r.call(this);var e=R(this);try{t(at(ut,e),at(st,e))}catch(t){st(e,t)}}).prototype,(r=function(t){L(this,{type:M,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=d(V,{then:function(t,e){var n=z(this),r=J(E(this,U));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=B?W.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&et(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=R(t);this.promise=t,this.resolve=at(ut,e),this.reject=at(st,e)},O.f=J=function(t){return t===U||t===i?new o(t):G(t)},!u&&"function"==typeof f&&N!==Object.prototype)){a=N.then,K||(p(N,"then",(function(t,e){var n=this;return new U((function(t,e){a.call(n,t,e)})).then(t,e)}),{unsafe:!0}),p(N,"catch",V.catch,{unsafe:!0}));try{delete N.constructor}catch(t){}h&&h(N,V)}s({global:!0,wrap:!0,forced:Z},{Promise:U}),v(U,M,!1,!0),m(M),i=l(M),s({target:M,stat:!0,forced:Z},{reject:function(t){var e=J(this);return e.reject.call(void 0,t),e.promise}}),s({target:M,stat:!0,forced:u||Z},{resolve:function(t){return C(u&&this===i?U:this,t)}}),s({target:M,stat:!0,forced:X},{all:function(t){var e=this,n=J(e),r=n.resolve,o=n.reject,i=S((function(){var n=y(e.resolve),i=[],a=0,s=1;x(t,(function(t){var u=a++,c=!1;i.push(void 0),s++,n.call(e,t).then((function(t){c||(c=!0,i[u]=t,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=J(e),r=n.reject,o=S((function(){var o=y(e.resolve);x(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},function(t,e,n){var r=n(15);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},function(t,e,n){var r=n(8),o=n(153),i=n(14),a=n(81),s=n(154),u=n(156),c=function(t,e){this.stopped=t,this.result=e};t.exports=function(t,e,n){var l,f,p,d,h,v,m,g=n&&n.that,y=!(!n||!n.AS_ENTRIES),b=!(!n||!n.IS_ITERATOR),w=!(!n||!n.INTERRUPTED),x=a(e,g,1+y+w),_=function(t){return l&&u(l),new c(!0,t)},E=function(t){return y?(r(t),w?x(t[0],t[1],_):x(t[0],t[1])):w?x(t,_):x(t)};if(b)l=t;else{if("function"!=typeof(f=s(t)))throw TypeError("Target is not iterable");if(o(f)){for(p=0,d=i(t.length);d>p;p++)if((h=E(t[p]))&&h instanceof c)return h;return new c(!1)}l=f.call(t)}for(v=l.next;!(m=v.call(l)).done;){try{h=E(m.value)}catch(t){throw u(l),t}if("object"==typeof h&&h&&h instanceof c)return h}return new c(!1)}},function(t,e,n){var r,o,i,a,s,u,c,l,f=n(3),p=n(30).f,d=n(158).set,h=n(159),v=n(244),m=n(82),g=f.MutationObserver||f.WebKitMutationObserver,y=f.document,b=f.process,w=f.Promise,x=p(f,"queueMicrotask"),_=x&&x.value;_||(r=function(){var t,e;for(m&&(t=b.domain)&&t.exit();o;){e=o.fn,o=o.next;try{e()}catch(t){throw o?a():i=void 0,t}}i=void 0,t&&t.enter()},h||m||v||!g||!y?w&&w.resolve?((c=w.resolve(void 0)).constructor=w,l=c.then,a=function(){l.call(c,r)}):a=m?function(){b.nextTick(r)}:function(){d.call(f,r)}:(s=!0,u=y.createTextNode(""),new g(r).observe(u,{characterData:!0}),a=function(){u.data=s=!s})),t.exports=_||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,a()),i=e}},function(t,e,n){var r=n(75);t.exports=/web0s(?!.*chrome)/i.test(r)},function(t,e,n){var r=n(3);t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},function(t,e){t.exports="object"==typeof window},function(t,e,n){var r=n(1),o=n(249);r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},function(t,e,n){"use strict";var r=n(7),o=n(2),i=n(76),a=n(106),s=n(105),u=n(12),c=n(52),l=Object.assign,f=Object.defineProperty;t.exports=!l||o((function(){if(r&&1!==l({b:1},l(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol();return t[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(t){e[t]=t})),7!=l({},t)[n]||"abcdefghijklmnopqrst"!=i(l({},e)).join("")}))?function(t,e){for(var n=u(t),o=arguments.length,l=1,f=a.f,p=s.f;o>l;)for(var d,h=c(arguments[l++]),v=f?i(h).concat(f(h)):i(h),m=v.length,g=0;m>g;)d=v[g++],r&&!p.call(h,d)||(n[d]=h[d]);return n}:l},function(t,e,n){"use strict";var r=n(1),o=n(34),i=n(151),a=n(2),s=n(29),u=n(109),c=n(160),l=n(15);if(r({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){i.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=u(this,s("Promise")),n="function"==typeof t;return this.then(n?function(n){return c(e,t()).then((function(){return n}))}:t,n?function(n){return c(e,t()).then((function(){throw n}))}:t)}}),!o&&"function"==typeof i){var f=s("Promise").prototype.finally;i.prototype.finally!==f&&l(i.prototype,"finally",f,{unsafe:!0})}},function(t,e,n){"use strict";var r=n(108),o=n(155);t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},function(t,e,n){var r=n(31),o=n(12),i=n(52),a=n(14),s=function(t){return function(e,n,s,u){r(n);var c=o(e),l=i(c),f=a(c.length),p=t?f-1:0,d=t?-1:1;if(s<2)for(;;){if(p in l){u=l[p],p+=d;break}if(p+=d,t?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;t?p>=0:f>p;p+=d)p in l&&(u=n(u,l[p],p,c));return u}};t.exports={left:s(!1),right:s(!0)}},function(t,e,n){"use strict";var r,o=n(1),i=n(30).f,a=n(14),s=n(168),u=n(18),c=n(169),l=n(34),f="".startsWith,p=Math.min,d=c("startsWith");o({target:"String",proto:!0,forced:!!(l||d||(r=i(String.prototype,"startsWith"),!r||r.writable))&&!d},{startsWith:function(t){var e=String(u(this));s(t);var n=a(p(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return f?f.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){var r=n(1),o=n(171),i=n(2),a=n(5),s=n(255).onFreeze,u=Object.freeze;r({target:"Object",stat:!0,forced:i((function(){u(1)})),sham:!o},{freeze:function(t){return u&&a(t)?u(s(t)):t}})},function(t,e,n){var r=n(55),o=n(5),i=n(11),a=n(10).f,s=n(74),u=n(171),c=s("meta"),l=0,f=Object.isExtensible||function(){return!0},p=function(t){a(t,c,{value:{objectID:"O"+ ++l,weakData:{}}})},d=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,c)){if(!f(t))return"F";if(!e)return"E";p(t)}return t[c].objectID},getWeakData:function(t,e){if(!i(t,c)){if(!f(t))return!0;if(!e)return!1;p(t)}return t[c].weakData},onFreeze:function(t){return u&&d.REQUIRED&&f(t)&&!i(t,c)&&p(t),t}};r[c]=!0},function(t,e,n){var r=n(21),o=n(57).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return a.slice()}}(t):o(r(t))}},function(t,e,n){"use strict";var r=n(81),o=n(12),i=n(258),a=n(153),s=n(14),u=n(70),c=n(154);t.exports=function(t){var e,n,l,f,p,d,h=o(t),v="function"==typeof this?this:Array,m=arguments.length,g=m>1?arguments[1]:void 0,y=void 0!==g,b=c(h),w=0;if(y&&(g=r(g,m>2?arguments[2]:void 0,2)),null==b||v==Array&&a(b))for(n=new v(e=s(h.length));e>w;w++)d=y?g(h[w],w):h[w],u(n,w,d);else for(p=(f=b.call(h)).next,n=new v;!(l=p.call(f)).done;w++)d=y?i(f,g,[l.value,w],!0):l.value,u(n,w,d);return n.length=w,n}},function(t,e,n){var r=n(8),o=n(156);t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(e){throw o(t),e}}},function(t,e,n){var r=n(12),o=Math.floor,i="".replace,a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,u,c,l){var f=n+t.length,p=u.length,d=s;return void 0!==c&&(c=r(c),d=a),i.call(l,d,(function(r,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(f);case"<":a=c[i.slice(1,-1)];break;default:var s=+i;if(0===s)return r;if(s>p){var l=o(s/10);return 0===l?r:l<=p?void 0===u[l-1]?i.charAt(1):u[l-1]+i.charAt(1):r}a=u[s-1]}return void 0===a?"":a}))}},function(t,e,n){"use strict";var r=n(1),o=n(102).includes,i=n(97);r({target:"Array",proto:!0},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("includes")},function(t,e,n){"use strict";var r=n(1),o=n(168),i=n(18);r({target:"String",proto:!0,forced:!n(169)("includes")},{includes:function(t){return!!~String(i(this)).indexOf(o(t),arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(177),o=n(263);t.exports=function t(e,n,i,a,s){var u=-1,c=e.length;for(i||(i=o),s||(s=[]);++u<c;){var l=e[u];n>0&&i(l)?n>1?t(l,n-1,i,a,s):r(s,l):a||(s[s.length]=l)}return s}},function(t,e,n){var r=n(62),o=n(116),i=n(27),a=r?r.isConcatSpreadable:void 0;t.exports=function(t){return i(t)||o(t)||!!(a&&t&&t[a])}},function(t,e,n){var r=n(63),o=n(46);t.exports=function(t){return o(t)&&"[object Arguments]"==r(t)}},function(t,e,n){var r=n(62),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[s]=n:delete t[s]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(268),o=n(324),i=n(124),a=n(27),s=n(335);t.exports=function(t){return"function"==typeof t?t:null==t?i:"object"==typeof t?a(t)?o(t[0],t[1]):r(t):s(t)}},function(t,e,n){var r=n(269),o=n(323),i=n(195);t.exports=function(t){var e=o(t);return 1==e.length&&e[0][2]?i(e[0][0],e[0][1]):function(n){return n===t||r(n,t,e)}}},function(t,e,n){var r=n(179),o=n(183);t.exports=function(t,e,n,i){var a=n.length,s=a,u=!i;if(null==t)return!s;for(t=Object(t);a--;){var c=n[a];if(u&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<s;){var l=(c=n[a])[0],f=t[l],p=c[1];if(u&&c[2]){if(void 0===f&&!(l in t))return!1}else{var d=new r;if(i)var h=i(f,p,l,t,e,d);if(!(void 0===h?o(p,f,3,i,d):h))return!1}}return!0}},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(87),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(87);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(87);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(87);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(86);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(86),o=n(117),i=n(119);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(181),o=n(281),i=n(118),a=n(182),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?p:s).test(a(t))}},function(t,e,n){var r,o=n(282),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(26)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(285),o=n(86),i=n(117);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(286),o=n(287),i=n(288),a=n(289),s=n(290);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=o,u.prototype.get=i,u.prototype.has=a,u.prototype.set=s,t.exports=u},function(t,e,n){var r=n(88);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(88),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(88),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var r=n(88);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,n){var r=n(89);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(89);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(89);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(89);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var r=n(179),o=n(184),i=n(300),a=n(303),s=n(319),u=n(27),c=n(188),l=n(191),f="[object Object]",p=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,d,h,v){var m=u(t),g=u(e),y=m?"[object Array]":s(t),b=g?"[object Array]":s(e),w=(y="[object Arguments]"==y?f:y)==f,x=(b="[object Arguments]"==b?f:b)==f,_=y==b;if(_&&c(t)){if(!c(e))return!1;m=!0,w=!1}if(_&&!w)return v||(v=new r),m||l(t)?o(t,e,n,d,h,v):i(t,e,y,n,d,h,v);if(!(1&n)){var E=w&&p.call(t,"__wrapped__"),A=x&&p.call(e,"__wrapped__");if(E||A){var k=E?t.value():t,C=A?e.value():e;return v||(v=new r),h(k,C,n,d,v)}}return!!_&&(v||(v=new r),a(t,e,n,d,h,v))}},function(t,e){t.exports=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}},function(t,e,n){var r=n(62),o=n(301),i=n(180),a=n(184),s=n(302),u=n(120),c=r?r.prototype:void 0,l=c?c.valueOf:void 0;t.exports=function(t,e,n,r,c,f,p){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!f(new o(t),new o(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var d=s;case"[object Set]":var h=1&r;if(d||(d=u),t.size!=e.size&&!h)return!1;var v=p.get(t);if(v)return v==e;r|=2,p.set(t,e);var m=a(d(t),d(e),r,c,f,p);return p.delete(t),m;case"[object Symbol]":if(l)return l.call(t)==l.call(e)}return!1}},function(t,e,n){var r=n(26).Uint8Array;t.exports=r},function(t,e){t.exports=function(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}},function(t,e,n){var r=n(304),o=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,i,a,s){var u=1&n,c=r(t),l=c.length;if(l!=r(e).length&&!u)return!1;for(var f=l;f--;){var p=c[f];if(!(u?p in e:o.call(e,p)))return!1}var d=s.get(t),h=s.get(e);if(d&&h)return d==e&&h==t;var v=!0;s.set(t,e),s.set(e,t);for(var m=u;++f<l;){var g=t[p=c[f]],y=e[p];if(i)var b=u?i(y,g,p,e,t,s):i(g,y,p,t,e,s);if(!(void 0===b?g===y||a(g,y,n,i,s):b)){v=!1;break}m||(m="constructor"==p)}if(v&&!m){var w=t.constructor,x=e.constructor;w==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof w&&w instanceof w&&"function"==typeof x&&x instanceof x||(v=!1)}return s.delete(t),s.delete(e),v}},function(t,e,n){var r=n(305),o=n(306),i=n(187);t.exports=function(t){return r(t,i,o)}},function(t,e,n){var r=n(177),o=n(27);t.exports=function(t,e,n){var i=e(t);return o(t)?i:r(i,n(t))}},function(t,e,n){var r=n(307),o=n(308),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(t){return null==t?[]:(t=Object(t),r(a(t),(function(e){return i.call(t,e)})))}:o;t.exports=s},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}},function(t,e){t.exports=function(){return[]}},function(t,e,n){var r=n(310),o=n(116),i=n(27),a=n(188),s=n(190),u=n(191),c=Object.prototype.hasOwnProperty;t.exports=function(t,e){var n=i(t),l=!n&&o(t),f=!n&&!l&&a(t),p=!n&&!l&&!f&&u(t),d=n||l||f||p,h=d?r(t.length,String):[],v=h.length;for(var m in t)!e&&!c.call(t,m)||d&&("length"==m||f&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||s(m,v))||h.push(m);return h}},function(t,e){t.exports=function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}},function(t,e){t.exports=function(){return!1}},function(t,e,n){var r=n(63),o=n(121),i=n(46),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,t.exports=function(t){return i(t)&&o(t.length)&&!!a[r(t)]}},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){(function(t){var r=n(178),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,a=i&&i.exports===o&&r.process,s=function(){try{var t=i&&i.require&&i.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(t){}}();t.exports=s}).call(this,n(189)(t))},function(t,e,n){var r=n(316),o=n(317),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!r(t))return o(t);var e=[];for(var n in Object(t))i.call(t,n)&&"constructor"!=n&&e.push(n);return e}},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){var r=n(318)(Object.keys,Object);t.exports=r},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var r=n(320),o=n(117),i=n(321),a=n(193),s=n(322),u=n(63),c=n(182),l=c(r),f=c(o),p=c(i),d=c(a),h=c(s),v=u;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=v(new o)||i&&"[object Promise]"!=v(i.resolve())||a&&"[object Set]"!=v(new a)||s&&"[object WeakMap]"!=v(new s))&&(v=function(t){var e=u(t),n="[object Object]"==e?t.constructor:void 0,r=n?c(n):"";if(r)switch(r){case l:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return e}),t.exports=v},function(t,e,n){var r=n(35)(n(26),"DataView");t.exports=r},function(t,e,n){var r=n(35)(n(26),"Promise");t.exports=r},function(t,e,n){var r=n(35)(n(26),"WeakMap");t.exports=r},function(t,e,n){var r=n(194),o=n(187);t.exports=function(t){for(var e=o(t),n=e.length;n--;){var i=e[n],a=t[i];e[n]=[i,a,r(a)]}return e}},function(t,e,n){var r=n(183),o=n(325),i=n(332),a=n(122),s=n(194),u=n(195),c=n(90);t.exports=function(t,e){return a(t)&&s(e)?u(c(t),e):function(n){var a=o(n,t);return void 0===a&&a===e?i(n,t):r(e,a,3)}}},function(t,e,n){var r=n(196);t.exports=function(t,e,n){var o=null==t?void 0:r(t,e);return void 0===o?n:o}},function(t,e,n){var r=n(327),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,a=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(o,(function(t,n,r,o){e.push(r?o.replace(i,"$1"):n||t)})),e}));t.exports=a},function(t,e,n){var r=n(328);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(119);function o(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(o.Cache||r),n}o.Cache=r,t.exports=o},function(t,e,n){var r=n(330);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){var r=n(62),o=n(331),i=n(27),a=n(123),s=r?r.prototype:void 0,u=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return u?u.call(e):"";var n=e+"";return"0"==n&&1/e==-1/0?"-0":n}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}},function(t,e,n){var r=n(333),o=n(334);t.exports=function(t,e){return null!=t&&o(t,e,r)}},function(t,e){t.exports=function(t,e){return null!=t&&e in Object(t)}},function(t,e,n){var r=n(197),o=n(116),i=n(27),a=n(190),s=n(121),u=n(90);t.exports=function(t,e,n){for(var c=-1,l=(e=r(e,t)).length,f=!1;++c<l;){var p=u(e[c]);if(!(f=null!=t&&n(t,p)))break;t=t[p]}return f||++c!=l?f:!!(l=null==t?0:t.length)&&s(l)&&a(p,l)&&(i(t)||o(t))}},function(t,e,n){var r=n(336),o=n(337),i=n(122),a=n(90);t.exports=function(t){return i(t)?r(a(t)):o(t)}},function(t,e){t.exports=function(t){return function(e){return null==e?void 0:e[t]}}},function(t,e,n){var r=n(196);t.exports=function(t){return function(e){return r(e,t)}}},function(t,e,n){var r=n(124),o=n(339),i=n(341);t.exports=function(t,e){return i(o(t,e,r),t+"")}},function(t,e,n){var r=n(340),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,s=o(i.length-e,0),u=Array(s);++a<s;)u[a]=i[e+a];a=-1;for(var c=Array(e+1);++a<e;)c[a]=i[a];return c[e]=n(u),r(t,this,c)}}},function(t,e){t.exports=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}},function(t,e,n){var r=n(342),o=n(345)(r);t.exports=o},function(t,e,n){var r=n(343),o=n(344),i=n(124),a=o?function(t,e){return o(t,"toString",{configurable:!0,enumerable:!1,value:r(e),writable:!0})}:i;t.exports=a},function(t,e){t.exports=function(t){return function(){return t}}},function(t,e,n){var r=n(35),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e){var n=Date.now;t.exports=function(t){var e=0,r=0;return function(){var o=n(),i=16-(o-r);if(r=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(185),o=n(347),i=n(352),a=n(186),s=n(353),u=n(120);t.exports=function(t,e,n){var c=-1,l=o,f=t.length,p=!0,d=[],h=d;if(n)p=!1,l=i;else if(f>=200){var v=e?null:s(t);if(v)return u(v);p=!1,l=a,h=new r}else h=e?[]:d;t:for(;++c<f;){var m=t[c],g=e?e(m):m;if(m=n||0!==m?m:0,p&&g==g){for(var y=h.length;y--;)if(h[y]===g)continue t;e&&h.push(g),d.push(m)}else l(h,g,n)||(h!==d&&h.push(g),d.push(m))}return d}},function(t,e,n){var r=n(348);t.exports=function(t,e){return!!(null==t?0:t.length)&&r(t,e,0)>-1}},function(t,e,n){var r=n(349),o=n(350),i=n(351);t.exports=function(t,e,n){return e==e?i(t,e,n):r(t,o,n)}},function(t,e){t.exports=function(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}},function(t,e){t.exports=function(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}},function(t,e,n){var r=n(193),o=n(354),i=n(120),a=r&&1/i(new r([,-0]))[1]==1/0?function(t){return new r(t)}:o;t.exports=a},function(t,e){t.exports=function(){}},function(t,e,n){var r=n(192),o=n(46);t.exports=function(t){return o(t)&&r(t)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";var r=n(2),o=n(360).start,i=Math.abs,a=Date.prototype,s=a.getTime,u=a.toISOString;t.exports=r((function(){return"0385-07-25T07:06:39.999Z"!=u.call(new Date(-50000000000001))}))||!r((function(){u.call(new Date(NaN))}))?function(){if(!isFinite(s.call(this)))throw RangeError("Invalid time value");var t=this.getUTCFullYear(),e=this.getUTCMilliseconds(),n=t<0?"-":t>9999?"+":"";return n+o(i(t),n?6:4,0)+"-"+o(this.getUTCMonth()+1,2,0)+"-"+o(this.getUTCDate(),2,0)+"T"+o(this.getUTCHours(),2,0)+":"+o(this.getUTCMinutes(),2,0)+":"+o(this.getUTCSeconds(),2,0)+"."+o(e,3,0)+"Z"}:u},function(t,e,n){var r=n(14),o=n(361),i=n(18),a=Math.ceil,s=function(t){return function(e,n,s){var u,c,l=String(i(e)),f=l.length,p=void 0===s?" ":String(s),d=r(n);return d<=f||""==p?l:(u=d-f,(c=o.call(p,a(u/p.length))).length>u&&(c=c.slice(0,u)),t?l+c:c+l)}};t.exports={start:s(!1),end:s(!0)}},function(t,e,n){"use strict";var r=n(51),o=n(18);t.exports=function(t){var e=String(o(this)),n="",i=r(t);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(e+=e))1&i&&(n+=e);return n}},function(t,e,n){"use strict";var r=n(113),o=n(110),i=n(8),a=n(18),s=n(109),u=n(114),c=n(14),l=n(115),f=n(85),p=n(112).UNSUPPORTED_Y,d=[].push,h=Math.min;r("split",2,(function(t,e,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var r=String(a(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===t)return[r];if(!o(t))return e.call(r,t,i);for(var s,u,c,l=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),h=0,v=new RegExp(t.source,p+"g");(s=f.call(v,r))&&!((u=v.lastIndex)>h&&(l.push(r.slice(h,s.index)),s.length>1&&s.index<r.length&&d.apply(l,s.slice(1)),c=s[0].length,h=u,l.length>=i));)v.lastIndex===s.index&&v.lastIndex++;return h===r.length?!c&&v.test("")||l.push(""):l.push(r.slice(h)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var o=a(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,n):r.call(String(o),e,n)},function(t,o){var a=n(r,t,this,o,r!==e);if(a.done)return a.value;var f=i(t),d=String(this),v=s(f,RegExp),m=f.unicode,g=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(p?"g":"y"),y=new v(p?"^(?:"+f.source+")":f,g),b=void 0===o?4294967295:o>>>0;if(0===b)return[];if(0===d.length)return null===l(y,d)?[d]:[];for(var w=0,x=0,_=[];x<d.length;){y.lastIndex=p?0:x;var E,A=l(y,p?d.slice(x):d);if(null===A||(E=h(c(y.lastIndex+(p?x:0)),d.length))===w)x=u(d,x,m);else{if(_.push(d.slice(w,x)),_.length===b)return _;for(var k=1;k<=A.length-1;k++)if(_.push(A[k]),_.length===b)return _;x=w=E}}return _.push(d.slice(w)),_}]}),p)},function(t,e,n){var r=n(1),o=n(7);r({target:"Object",stat:!0,forced:!o,sham:!o},{defineProperties:n(143)})},function(t,e,n){"use strict";var r=n(1),o=n(43).find,i=n(97),a=!0;"find"in[]&&Array(1).find((function(){a=!1})),r({target:"Array",proto:!0,forced:a},{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("find")},function(t,e,n){},function(t,e,n){n(1)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},function(t,e,n){"use strict";n(200)},function(t,e,n){"use strict";var r=n(7),o=n(3),i=n(78),a=n(15),s=n(11),u=n(33),c=n(199),l=n(40),f=n(2),p=n(41),d=n(57).f,h=n(30).f,v=n(10).f,m=n(135).trim,g=o.Number,y=g.prototype,b="Number"==u(p(y)),w=function(t){var e,n,r,o,i,a,s,u,c=l(t,!1);if("string"==typeof c&&c.length>2)if(43===(e=(c=m(c)).charCodeAt(0))||45===e){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+c}for(a=(i=c.slice(2)).length,s=0;s<a;s++)if((u=i.charCodeAt(s))<48||u>o)return NaN;return parseInt(i,r)}return+c};if(i("Number",!g(" 0o1")||!g("0b1")||g("+0x1"))){for(var x,_=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof _&&(b?f((function(){y.valueOf.call(n)})):"Number"!=u(n))?c(new g(w(e)),n,_):w(e)},E=r?d(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),A=0;E.length>A;A++)s(g,x=E[A])&&!s(_,x)&&v(_,x,h(g,x));_.prototype=y,y.constructor=_,a(o,"Number",_)}},function(t,e,n){var r=n(3),o=n(135).trim,i=n(136),a=r.parseInt,s=/^[+-]?0[Xx]/,u=8!==a(i+"08")||22!==a(i+"0x16");t.exports=u?function(t,e){var n=o(String(t));return a(n,e>>>0||(s.test(n)?16:10))}:a},function(t,e,n){"use strict";n(201)},function(t,e,n){ +/*! + * Valine v1.5.1 + * (c) 2017-2022 xCss + * Released under the GPL-2.0 License. + * Last Update: 2022-7-21 3:43:59 ├F10: PM┤ + */ +t.exports=function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=108)}([function(t,e,n){"use strict";var r=SyntaxError,o=Function,i=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},s=Object.getOwnPropertyDescriptor;if(s)try{s({},"")}catch(t){s=null}var u=function(){throw new i},c=s?function(){try{return u}catch(t){try{return s(arguments,"callee").get}catch(t){return u}}}():u,l=n(22)(),f=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?void 0:f(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":l?f([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?f(f([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?f((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?f((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?f(""[Symbol.iterator]()):void 0,"%Symbol%":l?Symbol:void 0,"%SyntaxError%":r,"%ThrowTypeError%":c,"%TypedArray%":d,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},v=function t(e){var n;if("%AsyncFunction%"===e)n=a("async function () {}");else if("%GeneratorFunction%"===e)n=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)n=a("async function* () {}");else if("%AsyncGenerator%"===e){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(n=f(o.prototype))}return h[e]=n,n},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=n(9),y=n(25),b=g.call(Function.call,Array.prototype.concat),w=g.call(Function.apply,Array.prototype.splice),x=g.call(Function.call,String.prototype.replace),_=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,k=function(t){var e=_(t,0,1),n=_(t,-1);if("%"===e&&"%"!==n)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==e)throw new r("invalid intrinsic syntax, expected opening `%`");var o=[];return x(t,E,(function(t,e,n,r){o[o.length]=n?x(r,A,"$1"):e||t})),o},C=function(t,e){var n,o=t;if(y(m,o)&&(o="%"+(n=m[o])[0]+"%"),y(h,o)){var a=h[o];if(a===p&&(a=v(o)),void 0===a&&!e)throw new i("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:o,value:a}}throw new r("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new i('"allowMissing" argument must be a boolean');var n=k(t),o=n.length>0?n[0]:"",a=C("%"+o+"%",e),u=a.name,c=a.value,l=!1,f=a.alias;f&&(o=f[0],w(n,b([0,1],f)));for(var p=1,d=!0;p<n.length;p+=1){var v=n[p],m=_(v,0,1),g=_(v,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new r("property names with quotes must have matching quotes");if("constructor"!==v&&d||(l=!0),y(h,u="%"+(o+="."+v)+"%"))c=h[u];else if(null!=c){if(!(v in c)){if(!e)throw new i("base intrinsic for "+t+" exists, but the property is not available.");return}if(s&&p+1>=n.length){var x=s(c,v);c=(d=!!x)&&"get"in x&&!("originalValue"in x.get)?x.get:c[v]}else d=y(c,v),c=c[v];d&&!l&&(h[u]=c)}}return c}},function(t,e,n){"use strict";var r=n(0),o=n(4),i=o(r("String.prototype.indexOf"));t.exports=function(t,e){var n=r(t,!!e);return"function"==typeof n&&i(t,".prototype.")>-1?o(n):n}},function(t,e,n){"use strict";var r=n(88),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=s&&function(){var t={};try{for(var e in s(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),c=function(t,e,n,r){(!(e in t)||function(t){return"function"==typeof t&&"[object Function]"===i.call(t)}(r)&&r())&&(u?s(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},l=function(t,e){var n=arguments.length>2?arguments[2]:{},i=r(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s<i.length;s+=1)c(t,i[s],e[i[s]],n[i[s]])};l.supportsDescriptors=!!u,t.exports=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=r(n(85)),a=r(n(49)),s=r(n(46)),u=r(n(48)),c=r(n(45)),l=document,f=navigator,p=/[&<>"'`\\]/g,d=RegExp(p.source),h=/&(?:amp|lt|gt|quot|#39|#x60|#x5c);/g,v=RegExp(h.source),m={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\\":"\"},g={};for(var y in m)g[m[y]]=y;var b=null;Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var n,r;if(null==this)throw new TypeError(" this is null or not defined");var o=Object(this),i=o.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(arguments.length>1&&(n=e),r=0;r<i;){var a;r in o&&(a=o[r],t.call(n,a,r,o)),r++}}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}),(0,i.default)(a.default.fn,{prepend:function(t){return t instanceof HTMLElement||(t=t[0]),this.forEach((function(e){e.insertAdjacentElement("afterBegin",t)})),this},append:function(t){return t instanceof HTMLElement||(t=t[0]),this.forEach((function(e){e.insertAdjacentElement("beforeEnd",t)})),this},remove:function(){return this.forEach((function(t){try{t.parentNode.removeChild(t)}catch(t){}})),this},find:function(t){return(0,a.default)(t,this)},show:function(){return this.forEach((function(t){t.style.display="block"})),this},hide:function(){return this.forEach((function(t){t.style.display="none"})),this},on:function(t,e,n){return a.default.fn.off(t,e,n),this.forEach((function(r){t.split(" ").forEach((function(t){r.addEventListener?r.addEventListener(t,e,n||!1):r.attachEvent?r.attachEvent("on"+t,e):r["on"+t]=e}))})),this},off:function(t,e,n){return this.forEach((function(r){t.split(" ").forEach((function(t){r.removeEventListener?r.removeEventListener(t,e,n||!1):r.detachEvent?r.detachEvent("on"+t,e):r["on"+t]=null}))})),this},html:function(t){return void 0!==t?(this.forEach((function(e){e.innerHTML=t})),this):this[0].innerHTML},text:function(t){return void 0!==t?(this.forEach((function(e){e.innerText=t})),this):this[0].innerText},empty:function(t){return t=t||0,this.forEach((function(e){setTimeout((function(t){e.innerText=""}),t)})),this},val:function(t){return void 0!==t?(this.forEach((function(e){e.value=t})),this):this[0].value||""},attr:function(){var t=arguments;if("object"==o(arguments[0])){var e=arguments[0],n=this;return Object.keys(e).forEach((function(t){n.forEach((function(n){n.setAttribute(t,e[t])}))})),this}return"string"==typeof arguments[0]&&arguments.length<2?this[0].getAttribute(arguments[0])||"":(this.forEach((function(e){e.setAttribute(t[0],t[1])})),this)},removeAttr:function(t){return this.forEach((function(e){var n,r=0,o=t&&t.match(/[^\x20\t\r\n\f\*\/\\]+/g);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)})),this},hasClass:function(t){return!!this[0]&&new RegExp("(\\s|^)"+t+"(\\s|$)").test(this[0].getAttribute("class"))},addClass:function(t){return this.forEach((function(e){var n=(0,a.default)(e),r=n.attr("class");n.hasClass(t)||n.attr("class",r+=" "+t)})),this},removeClass:function(t){return this.forEach((function(e){var n=(0,a.default)(e),r=n.attr("class");if(n.hasClass(t)){var o=new RegExp("(\\s|^)"+t+"(\\s|$)");n.attr("class",r.replace(o,""))}})),this}}),(0,i.default)(a.default,{extend:i.default,noop:function(){},navi:f,ua:f.userAgent,lang:f.language||f.languages[0],detect:s.default,store:u.default,escape:function(t){return t&&d.test(t)?t.replace(p,(function(t){return m[t]})):t},unescape:function(t){return t&&v.test(t)?t.replace(h,(function(t){return g[t]})):t},dynamicLoadSource:function(t,e){if((0,a.default)('script[src="'+t+'"]').length)e&&e();else{var n=l.createElement("script");n.onload=n.onreadystatechange=function(){this.onload=this.onreadystatechange=null,e&&e(),(0,a.default)(n).remove()},n.async=!0,n.setAttribute("referrerPolicy","no-referrer"),(0,a.default)("head")[0].appendChild(n),n.src=t}},sdkLoader:function(t,e,n){e in window&&window[e]?(b&&clearTimeout(b),n&&n()):a.default.dynamicLoadSource(t,(function(){b=setTimeout(a.default.sdkLoader(t,e,n),100)}))},deleteInWin:function(t,e){var n=function(e){if(t in window)try{delete window[t]}catch(e){window[t]=null}};0===e?n():setTimeout(n,e||500)},ajax:c.default}),e.default=a.default},function(t,e,n){"use strict";var r=n(9),o=n(0),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(r,a,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(r,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},function(t,e,n){"use strict";t.exports=n(62)},function(t,e,n){"use strict";e.__esModule=!0,e.DEFAULT_EMOJI_CDN="//img.t.sinajs.cn/t4/appstyle/expression/ext/normal/",e.DB_NAME="Comment",e.CONFIG={lang:"zh-CN",langMode:null,appId:"",appKey:"",clazzName:"Comment",meta:["nick","mail","link"],path:location.pathname,placeholder:"Just Go Go",pageSize:10,recordIP:!0,serverURLs:"",visitor:!1,mathJax:!1,emojiCDN:"",emojiMaps:void 0,enableQQ:!1,requiredFields:[]},e.defaultMeta=["nick","mail","link"],e.QQCacheKey="_v_Cache_Q",e.MetaCacheKey="_v_Cache_Meta",e.RandomStr=function(t){return(Date.now()+Math.round(1e3*Math.random())).toString(32)},e.VERSION="1.5.1"},function(t,e,n){var r=n(16),o=n(50);for(var i in(e=t.exports=function(t,e){return new o(e).process(t)}).FilterCSS=o,r)e[i]=r[i];"undefined"!=typeof window&&(window.filterCSS=t.exports)},function(t,e,n){"use strict";var r=n(66);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":r(t)}},function(t,e,n){"use strict";var r=n(78);t.exports=Function.prototype.bind||r},function(t,e,n){"use strict";var r,o,i=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw o}}),o={},a((function(){throw 42}),null,r)}catch(t){t!==o&&(a=null)}else a=null;var s=/^\s*class\b/,u=function(t){try{var e=i.call(t);return s.test(e)}catch(t){return!1}},c=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,f="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=a?function(t){if(t===f)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;try{a(t,null,r)}catch(t){if(t!==o)return!1}return!u(t)}:function(t){if(t===f)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if("function"==typeof t&&!t.prototype)return!0;if(l)return function(t){try{return!u(t)&&(i.call(t),!0)}catch(t){return!1}}(t);if(u(t))return!1;var e=c.call(t);return"[object Function]"===e||"[object GeneratorFunction]"===e}},function(t,e){t.exports={indexOf:function(t,e){var n,r;if(Array.prototype.indexOf)return t.indexOf(e);for(n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},forEach:function(t,e,n){var r,o;if(Array.prototype.forEach)return t.forEach(e,n);for(r=0,o=t.length;r<o;r++)e.call(n,t[r],r,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}}},function(t,e,n){"use strict";e.__esModule=!0;var r={cdn:n(6).DEFAULT_EMOJI_CDN,maps:n(97),parse:function(t,e){return String(t).replace(new RegExp(":("+Object.keys(r.maps).join("|")+"):","ig"),(function(t,n){return r.maps[n]?r.build(n,e):t}))},build:function(t,e){var n=/^(https?:)?\/\//i,o=r.maps[t],i=n.test(o)?o:r.cdn+o,a=' <img alt="'+t+'" referrerpolicy="no-referrer" class="vemoji" src="'+i+'" />';return n.test(i)?a:""}};e.default=r},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(95));e.default=function(t){return(0,r.default)(t,{onTagAttr:function(t,e,n,r){return o(t,e,n,r)},onIgnoreTagAttr:function(t,e,n,r){return o(t,e,n,r)}}).replace(/\<\/?div\>/gi,"")};var o=function(t,e,n,o){if(/video|audio/i.test(t))return"";if(/code|pre|span/i.test(t)){if("style"==e){var i=n.match(/color:([#a-z0-9]{3,7}|\s+[#a-z0-9]{3,8})/gi);return i&&i.length?'style="'+i[0]+'"':""}if("class"==e)return e+"='"+r.default.escapeAttrValue(n)+"'"}return"a"===t&&"class"==e&&"at"===n?e+"='"+r.default.escapeAttrValue(n)+"'":"img"===t&&/src|class/i.test(e)?e+"='"+r.default.escapeAttrValue(n)+"' referrerPolicy='no-referrer'":void 0}},function(t,e,n){"use strict";var r=n(0),o=n(1),i=r("%TypeError%"),a=n(52),s=n(18),u=n(53),c=n(55),l=n(56),f=n(60),p=n(20),d=n(81),h=o("String.prototype.split"),v=Object("a"),m="a"!==v[0]||!(0 in v);t.exports=function(t){var e,n=f(this),r=m&&d(this)?h(this,""):n,o=l(r);if(!c(t))throw new i("Array.prototype.forEach callback must be a function");arguments.length>1&&(e=arguments[1]);for(var v=0;v<o;){var g=p(v);if(u(r,g)){var y=s(r,g);a(t,e,[y,v,r])}v+=1}}},function(t,e,n){"use strict";var r=n(75),o=n(14);t.exports=function(){var t=Array.prototype.forEach;return r(t)?t:o}},function(t,e){function n(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var r=/javascript\s*\:/gim;e.whiteList=n(),e.getDefaultWhiteList=n,e.onAttr=function(t,e,n){},e.onIgnoreAttr=function(t,e,n){},e.safeAttrValue=function(t,e){return r.test(e)?"":e}},function(t,e){t.exports={indexOf:function(t,e){var n,r;if(Array.prototype.indexOf)return t.indexOf(e);for(n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},forEach:function(t,e,n){var r,o;if(Array.prototype.forEach)return t.forEach(e,n);for(r=0,o=t.length;r<o;r++)e.call(n,t[r],r,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}}},function(t,e,n){"use strict";var r=n(0)("%TypeError%"),o=n(86),i=n(19),a=n(8);t.exports=function(t,e){if("Object"!==a(t))throw new r("Assertion failed: Type(O) is not Object");if(!i(e))throw new r("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},function(t,e,n){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},function(t,e,n){"use strict";var r=n(0),o=r("%String%"),i=r("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},function(t,e,n){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(23);t.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&o()}},function(t,e,n){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,e,n){"use strict";var r=n(23);t.exports=function(){return r()&&!!Symbol.toStringTag}},function(t,e,n){"use strict";var r=n(9);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}},function(t,e,n){"use strict";var r=n(5),o=n(1),i=o("Object.prototype.propertyIsEnumerable"),a=o("Array.prototype.push");t.exports=function(t){var e=r(t),n=[];for(var o in e)i(e,o)&&a(n,[o,e[o]]);return n}},function(t,e,n){"use strict";var r=n(27);t.exports=function(){return"function"==typeof Object.entries?Object.entries:r}},function(t,e,n){"use strict";var r=n(5),o=n(20),i=n(1)("String.prototype.replace"),a=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(r(this));return i(i(t,a,""),s,"")}},function(t,e,n){"use strict";var r=n(29);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()?String.prototype.trim:r}},function(t,e,n){function r(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}function o(t){return t.replace(m,"<").replace(g,">")}function i(t){return t.replace(y,""")}function a(t){return t.replace(b,'"')}function s(t){return t.replace(w,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function u(t){return t.replace(x,":").replace(_," ")}function c(t){for(var e="",n=0,r=t.length;n<r;n++)e+=t.charCodeAt(n)<32?" ":t.charAt(n);return h.trim(e)}function l(t){return c(t=u(t=s(t=a(t))))}function f(t){return o(t=i(t))}var p=n(7).FilterCSS,d=n(7).getDefaultWhiteList,h=n(11),v=new p,m=/</g,g=/>/g,y=/"/g,b=/"/g,w=/&#([a-zA-Z0-9]*);?/gim,x=/:?/gim,_=/&newline;?/gim,E=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,A=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,k=/u\s*r\s*l\s*\(.*/gi;e.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},e.getDefaultWhiteList=r,e.onTag=function(t,e,n){},e.onIgnoreTag=function(t,e,n){},e.onTagAttr=function(t,e,n){},e.onIgnoreTagAttr=function(t,e,n){},e.safeAttrValue=function(t,e,n,r){if(n=l(n),"href"===e||"src"===e){if("#"===(n=h.trim(n)))return"#";if("http://"!==n.substr(0,7)&&"https://"!==n.substr(0,8)&&"mailto:"!==n.substr(0,7)&&"tel:"!==n.substr(0,4)&&"data:image/"!==n.substr(0,11)&&"ftp://"!==n.substr(0,6)&&"./"!==n.substr(0,2)&&"../"!==n.substr(0,3)&&"#"!==n[0]&&"/"!==n[0])return""}else if("background"===e){if(E.lastIndex=0,E.test(n))return""}else if("style"===e){if(A.lastIndex=0,A.test(n))return"";if(k.lastIndex=0,k.test(n)&&(E.lastIndex=0,E.test(n)))return"";!1!==r&&(n=(r=r||v).process(n))}return f(n)},e.escapeHtml=o,e.escapeQuote=i,e.unescapeQuote=a,e.escapeHtmlEntities=s,e.escapeDangerHtml5Entities=u,e.clearNonPrintableCharacter=c,e.friendlyAttrValue=l,e.escapeAttrValue=f,e.onIgnoreTagStripAll=function(){return""},e.StripTagBody=function(t,e){function n(e){return!!r||-1!==h.indexOf(t,e)}"function"!=typeof e&&(e=function(){});var r=!Array.isArray(t),o=[],i=!1;return{onIgnoreTag:function(t,r,a){if(n(t)){if(a.isClosing){var s="[/removed]",u=a.position+s.length;return o.push([!1!==i?i:a.position,u]),i=!1,s}return i||(i=a.position),"[removed]"}return e(t,r,a)},remove:function(t){var e="",n=0;return h.forEach(o,(function(r){e+=t.slice(n,r[0]),n=r[1]})),e+=t.slice(n)}}},e.stripCommentTag=function(t){for(var e="",n=0;n<t.length;){var r=t.indexOf("\x3c!--",n);if(-1===r){e+=t.slice(n);break}e+=t.slice(n,r);var o=t.indexOf("--\x3e",r);if(-1===o)break;n=o+3}return e},e.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return!(127===e||e<=31&&10!==e&&13!==e)}))).join("")},e.cssFilter=v,e.getDefaultCSSWhiteList=d},function(t,e,n){function r(t){var e=u.spaceIndex(t);if(-1===e)var n=t.slice(1,-1);else n=t.slice(1,e+1);return"/"===(n=u.trim(n).toLowerCase()).slice(0,1)&&(n=n.slice(1)),"/"===n.slice(-1)&&(n=n.slice(0,-1)),n}function o(t){return"</"===t.slice(0,2)}function i(t,e){for(;e<t.length;e++){var n=t[e];if(" "!==n)return"="===n?e:-1}}function a(t,e){for(;e>0;e--){var n=t[e];if(" "!==n)return"="===n?e:-1}}function s(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}var u=n(11),c=/[^a-zA-Z0-9_:\.\-]/gim;e.parseTag=function(t,e,n){"use strict";var i="",a=0,s=!1,u=!1,c=0,l=t.length,f="",p="";t:for(c=0;c<l;c++){var d=t.charAt(c);if(!1===s){if("<"===d){s=c;continue}}else if(!1===u){if("<"===d){i+=n(t.slice(a,c)),s=c,a=c;continue}if(">"===d){i+=n(t.slice(a,s)),f=r(p=t.slice(s,c+1)),i+=e(s,i.length,f,p,o(p)),a=c+1,s=!1;continue}if('"'===d||"'"===d)for(var h=1,v=t.charAt(c-h);""===v.trim()||"="===v;){if("="===v){u=d;continue t}v=t.charAt(c-++h)}}else if(d===u){u=!1;continue}}return a<t.length&&(i+=n(t.substr(a))),i},e.parseAttr=function(t,e){"use strict";function n(t,n){if(!((t=(t=u.trim(t)).replace(c,"").toLowerCase()).length<1)){var r=e(t,n||"");r&&o.push(r)}}for(var r=0,o=[],l=!1,f=t.length,p=0;p<f;p++){var d,h=t.charAt(p);if(!1!==l||"="!==h)if(!1===l||p!==r||'"'!==h&&"'"!==h||"="!==t.charAt(p-1)){if(/\s|\n|\t/.test(h)){if(t=t.replace(/\s|\n|\t/g," "),!1===l){if(-1===(d=i(t,p))){n(u.trim(t.slice(r,p))),l=!1,r=p+1;continue}p=d-1;continue}if(-1===(d=a(t,p-1))){n(l,s(u.trim(t.slice(r,p)))),l=!1,r=p+1;continue}}}else{if(-1===(d=t.indexOf(h,p+1)))break;n(l,u.trim(t.slice(r+1,d))),l=!1,r=(p=d)+1}else l=t.slice(r,p),r=p+1}return r<t.length&&(!1===l?n(t.slice(r)):n(l,s(u.trim(t.slice(r))))),u.trim(o.join(" "))}},function(t,e,n){var r,o,i; +/*! + autosize 4.0.4 + license: MIT + http://www.jacklmoore.com/autosize +*/o=[t,e],r=function(t,e){"use strict";function n(t){function e(e){var n=t.style.width;t.style.width="0px",t.offsetWidth,t.style.width=n,t.style.overflowY=e}function n(){if(0!==t.scrollHeight){var e=function(t){for(var e=[];t&&t.parentNode&&t.parentNode instanceof Element;)t.parentNode.scrollTop&&e.push({node:t.parentNode,scrollTop:t.parentNode.scrollTop}),t=t.parentNode;return e}(t),n=document.documentElement&&document.documentElement.scrollTop;t.style.height="",t.style.height=t.scrollHeight+o+"px",s=t.clientWidth,e.forEach((function(t){t.node.scrollTop=t.scrollTop})),n&&(document.documentElement.scrollTop=n)}}function r(){n();var r=Math.round(parseFloat(t.style.height)),o=window.getComputedStyle(t,null),i="content-box"===o.boxSizing?Math.round(parseFloat(o.height)):t.offsetHeight;if(i<r?"hidden"===o.overflowY&&(e("scroll"),n(),i="content-box"===o.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight):"hidden"!==o.overflowY&&(e("hidden"),n(),i="content-box"===o.boxSizing?Math.round(parseFloat(window.getComputedStyle(t,null).height)):t.offsetHeight),u!==i){u=i;var s=a("autosize:resized");try{t.dispatchEvent(s)}catch(t){}}}if(t&&t.nodeName&&"TEXTAREA"===t.nodeName&&!i.has(t)){var o=null,s=null,u=null,c=function(){t.clientWidth!==s&&r()},l=function(e){window.removeEventListener("resize",c,!1),t.removeEventListener("input",r,!1),t.removeEventListener("keyup",r,!1),t.removeEventListener("autosize:destroy",l,!1),t.removeEventListener("autosize:update",r,!1),Object.keys(e).forEach((function(n){t.style[n]=e[n]})),i.delete(t)}.bind(t,{height:t.style.height,resize:t.style.resize,overflowY:t.style.overflowY,overflowX:t.style.overflowX,wordWrap:t.style.wordWrap});t.addEventListener("autosize:destroy",l,!1),"onpropertychange"in t&&"oninput"in t&&t.addEventListener("keyup",r,!1),window.addEventListener("resize",c,!1),t.addEventListener("input",r,!1),t.addEventListener("autosize:update",r,!1),t.style.overflowX="hidden",t.style.wordWrap="break-word",i.set(t,{destroy:l,update:r}),function(){var e=window.getComputedStyle(t,null);"vertical"===e.resize?t.style.resize="none":"both"===e.resize&&(t.style.resize="horizontal"),o="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(o)&&(o=0),r()}()}}function r(t){var e=i.get(t);e&&e.destroy()}function o(t){var e=i.get(t);e&&e.update()}var i="function"==typeof Map?new Map:function(){var t=[],e=[];return{has:function(e){return t.indexOf(e)>-1},get:function(n){return e[t.indexOf(n)]},set:function(n,r){-1===t.indexOf(n)&&(t.push(n),e.push(r))},delete:function(n){var r=t.indexOf(n);r>-1&&(t.splice(r,1),e.splice(r,1))}}}(),a=function(t){return new Event(t,{bubbles:!0})};try{new Event("test")}catch(t){a=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!1),e}}var s=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((s=function(t){return t}).destroy=function(t){return t},s.update=function(t){return t}):((s=function(t,e){return t&&Array.prototype.forEach.call(t.length?t:[t],(function(t){return n(t)})),t}).destroy=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],r),t},s.update=function(t){return t&&Array.prototype.forEach.call(t.length?t:[t],o),t}),e.default=s,t.exports=e.default},void 0!==(i="function"==typeof r?r.apply(e,o):r)&&(t.exports=i)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return!!t&&this.init(t),this}function i(t){return new o(t)}var a=r(n(42)),s=r(n(33)),u=r(n(37)),c=r(n(12)),l=n(6),f=r(n(41)),p=r(n(36)),d=n(40),h=r(n(38)),v=r(n(3)),m=r(n(39)),g=r(n(13)),y=(r(n(35)),{comment:"",nick:"",mail:"",link:"",ua:v.default.ua,url:"",QQAvatar:""}),b="",w={},x={cdn:"https://gravatar.loli.net/avatar/",ds:["mp","identicon","monsterid","wavatar","robohash","retro",""],params:"",hide:!1};o.prototype.init=function(t){if("undefined"==typeof document)throw new Error("Sorry, Valine does not support Server-side rendering.");var e=this;return t&&(t=v.default.extend(l.CONFIG,t),e.i18n=(0,u.default)(t.lang||v.default.lang,t.langMode),e.cfg=t,c.default.maps=!!t.emojiMaps&&t.emojiMaps||c.default.maps,c.default.cdn=!!t.emojiCDN&&t.emojiCDN||c.default.cdn,e._init()),e},o.prototype._init=function(){var t=this;try{var e=t.cfg,n=e.avatar,r=e.avatarForce,o=e.avatar_cdn,i=e.visitor,a=e.path,s=void 0===a?location.pathname:a,u=e.pageSize,c=e.recordIP;t.cfg.path=s.replace(/index\.html?$/,"");var f=x.ds,m=r?"&q="+(0,l.RandomStr)():"";x.params="?d="+(f.indexOf(n)>-1?n:"mp")+"&v="+l.VERSION+m,x.hide="hide"===n,x.cdn=/^https?\:\/\//.test(o)?o:x.cdn,t.cfg.pageSize=isNaN(u)||u<1?10:u,c&&(0,d.recordIPFn)((function(t){return y.ip=t}));var g=t.cfg.el||null,b=(0,v.default)(g);if(g=g instanceof HTMLElement?g:b[b.length-1]||null){t.$el=(0,v.default)(g),t.$el.addClass("v").attr("data-class","v"),x.hide&&t.$el.addClass("hide-avatar"),t.cfg.meta=(t.cfg.guest_info||t.cfg.meta||l.defaultMeta).filter((function(t){return l.defaultMeta.indexOf(t)>-1})),t.cfg.requiredFields=t.cfg.requiredFields.filter((function(t){return l.defaultMeta.indexOf(t)>-1}));var w=(0==t.cfg.meta.length?l.defaultMeta:t.cfg.meta).map((function(e){var n="mail"==e?"email":"text";return l.defaultMeta.indexOf(e)>-1?'<input name="'+e+'" placeholder="'+t.i18n.t(e)+'" class="v'+e+' vinput" type="'+n+'">':""})),_='<div class="vpanel"><div class="vwrap"><p class="cancel-reply text-right" style="display:none;" title="'+t.i18n.t("cancelReply")+'"><svg class="vicon cancel-reply-btn" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4220" width="22" height="22"><path d="M796.454 985H227.545c-50.183 0-97.481-19.662-133.183-55.363-35.7-35.701-55.362-83-55.362-133.183V227.545c0-50.183 19.662-97.481 55.363-133.183 35.701-35.7 83-55.362 133.182-55.362h568.909c50.183 0 97.481 19.662 133.183 55.363 35.701 35.702 55.363 83 55.363 133.183v568.909c0 50.183-19.662 97.481-55.363 133.183S846.637 985 796.454 985zM227.545 91C152.254 91 91 152.254 91 227.545v568.909C91 871.746 152.254 933 227.545 933h568.909C871.746 933 933 871.746 933 796.454V227.545C933 152.254 871.746 91 796.454 91H227.545z" p-id="4221"></path><path d="M568.569 512l170.267-170.267c15.556-15.556 15.556-41.012 0-56.569s-41.012-15.556-56.569 0L512 455.431 341.733 285.165c-15.556-15.556-41.012-15.556-56.569 0s-15.556 41.012 0 56.569L455.431 512 285.165 682.267c-15.556 15.556-15.556 41.012 0 56.569 15.556 15.556 41.012 15.556 56.569 0L512 568.569l170.267 170.267c15.556 15.556 41.012 15.556 56.569 0 15.556-15.556 15.556-41.012 0-56.569L568.569 512z" p-id="4222" ></path></svg></p><div class="vheader item'+w.length+'">'+w.join("")+'</div><div class="vedit"><textarea id="veditor" class="veditor vinput" placeholder="'+t.cfg.placeholder+'"></textarea><div class="vrow"><div class="vcol vcol-60 status-bar"></div><div class="vcol vcol-40 vctrl text-right"><span title="'+t.i18n.t("emoji")+'" class="vicon vemoji-btn"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16172" width="22" height="22" ><path d="M512 1024a512 512 0 1 1 512-512 512 512 0 0 1-512 512zM512 56.888889a455.111111 455.111111 0 1 0 455.111111 455.111111 455.111111 455.111111 0 0 0-455.111111-455.111111zM312.888889 512A85.333333 85.333333 0 1 1 398.222222 426.666667 85.333333 85.333333 0 0 1 312.888889 512z" p-id="16173"></path><path d="M512 768A142.222222 142.222222 0 0 1 369.777778 625.777778a28.444444 28.444444 0 0 1 56.888889 0 85.333333 85.333333 0 0 0 170.666666 0 28.444444 28.444444 0 0 1 56.888889 0A142.222222 142.222222 0 0 1 512 768z" p-id="16174"></path><path d="M782.222222 391.964444l-113.777778 59.733334a29.013333 29.013333 0 0 1-38.684444-10.808889 28.444444 28.444444 0 0 1 10.24-38.684445l113.777778-56.888888a28.444444 28.444444 0 0 1 38.684444 10.24 28.444444 28.444444 0 0 1-10.24 36.408888z" p-id="16175"></path><path d="M640.568889 451.697778l113.777778 56.888889a27.875556 27.875556 0 0 0 38.684444-10.24 27.875556 27.875556 0 0 0-10.24-38.684445l-113.777778-56.888889a28.444444 28.444444 0 0 0-38.684444 10.808889 28.444444 28.444444 0 0 0 10.24 38.115556z" p-id="16176"></path></svg></span><span title="'+t.i18n.t("preview")+'" class="vicon vpreview-btn"><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="17688" width="22" height="22"><path d="M502.390154 935.384615a29.538462 29.538462 0 1 1 0 59.076923H141.430154C79.911385 994.461538 29.538462 946.254769 29.538462 886.153846V137.846154C29.538462 77.745231 79.950769 29.538462 141.390769 29.538462h741.218462c61.44 0 111.852308 48.206769 111.852307 108.307692v300.268308a29.538462 29.538462 0 1 1-59.076923 0V137.846154c0-26.899692-23.355077-49.230769-52.775384-49.230769H141.390769c-29.420308 0-52.775385 22.331077-52.775384 49.230769v748.307692c0 26.899692 23.355077 49.230769 52.775384 49.230769h360.999385z" p-id="17689"></path><path d="M196.923077 216.615385m29.538461 0l374.153847 0q29.538462 0 29.538461 29.538461l0 0q0 29.538462-29.538461 29.538462l-374.153847 0q-29.538462 0-29.538461-29.538462l0 0q0-29.538462 29.538461-29.538461Z" p-id="17690"></path><path d="M649.846154 846.769231a216.615385 216.615385 0 1 0 0-433.230769 216.615385 216.615385 0 0 0 0 433.230769z m0 59.076923a275.692308 275.692308 0 1 1 0-551.384616 275.692308 275.692308 0 0 1 0 551.384616z" p-id="17691"></path><path d="M807.398383 829.479768m20.886847-20.886846l0 0q20.886846-20.886846 41.773692 0l125.321079 125.321079q20.886846 20.886846 0 41.773693l0 0q-20.886846 20.886846-41.773693 0l-125.321078-125.321079q-20.886846-20.886846 0-41.773693Z" p-id="17692"></path></svg></span></div></div></div><div class="vrow"><div class="vcol vcol-30" ><a alt="Markdown is supported" href="https://guides.github.com/features/mastering-markdown/" class="vicon" target="_blank"><svg class="markdown" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z"></path></svg></a></div><div class="vcol vcol-70 text-right"><button type="button" title="Cmd|Ctrl+Enter" class="vsubmit vbtn">'+t.i18n.t("submit")+'</button></div></div><div class="vemojis" style="display:none;"></div><div class="vinput vpreview" style="display:none;"></div></div></div><div class="vcount" style="display:none;"><span class="vnum">0</span> '+t.i18n.t("comments")+'</div><div class="vload-top text-center" style="display:none;"><i class="vspinner" style="width:30px;height:30px;"></i></div><div class="vcards"></div><div class="vload-bottom text-center" style="display:none;"><i class="vspinner" style="width:30px;height:30px;"></i></div><div class="vempty" style="display:none;"></div><div class="vpage txt-center" style="display:none"><button type="button" class="vmore vbtn">'+t.i18n.t("more")+'</button></div><div class="vpower txt-right">Powered By <a href="https://valine.js.org" target="_blank">Valine</a><br>v'+l.VERSION+"</div>";t.$el.html(_),t.$el.find(".cancel-reply").on("click",(function(e){t.reset()}));var A=t.$el.find(".vempty");t.$nodata={show:function(e){return A.html(e||t.i18n.t("sofa")).show(),t},hide:function(){return A.hide(),t}};var k=t.$el.find(".vload-bottom"),C=t.$el.find(".vload-top");t.$loading={show:function(e){return e&&C.show()||k.show(),t.$nodata.hide(),t},hide:function(){return C.hide(),k.hide(),0===t.$el.find(".vcard").length&&t.$nodata.show(),t}}}(0,p.default)(t.cfg,(function(e){var n=(0,v.default)(".valine-comment-count"),r=0;!function e(n){var o=n[r++];if(o){var i=(0,v.default)(o).attr("data-xid");i&&t.Q(i).count().then((function(t){o.innerText=t,e(n)})).catch((function(t){o.innerText=0}))}}(n),i&&E.add(AV.Object.extend("Counter"),t.cfg.path),t.$el&&t.bind()}))}catch(e){(0,h.default)(t,e,"init")}};var _=function(t,e){var n=new t,r=new AV.ACL;r.setPublicReadAccess(!0),r.setPublicWriteAccess(!0),n.setACL(r),n.set("url",e.url),n.set("xid",e.xid),n.set("title",e.title),n.set("time",1),n.save().then((function(t){(0,v.default)(e.el).find(".leancloud-visitors-count").text(1)})).catch((function(t){}))},E={add:function(t,e){var n=this,r=(0,v.default)(".leancloud_visitors,.leancloud-visitors");if(1===r.length){var o=r[0],i=decodeURI((0,v.default)(o).attr("id")),a=(0,v.default)(o).attr("data-flag-title"),s=encodeURI(i),u={el:o,url:i,xid:s,title:a};if(decodeURI(i)===decodeURI(e)){var c=new AV.Query(t);c.equalTo("url",i),c.find().then((function(e){if(e.length>0){var n=e[0];n.increment("time"),n.save().then((function(t){(0,v.default)(o).find(".leancloud-visitors-count").text(t.get("time"))})).catch((function(t){}))}else _(t,u)})).catch((function(e){101==e.code?_(t,u):(0,h.default)(n,e)}))}else E.show(t,r)}else E.show(t,r)},show:function(t,e){var n=[];if(e.forEach((function(t){var e=(0,v.default)(t).find(".leancloud-visitors-count");e&&e.text("0"),n.push(/\%/.test((0,v.default)(t).attr("id"))?decodeURI((0,v.default)(t).attr("id")):(0,v.default)(t).attr("id"))})),n.length){var r=new AV.Query(t);r.containedIn("url",n),r.find().then((function(t){t.length>0&&e.forEach((function(e){t.forEach((function(t){var n=t.get("xid")||encodeURI(t.get("url")),r=t.get("time"),o=(0,v.default)(e),i=o.attr("id");if((/\%/.test(i)?i:encodeURI(i))==n){var a=o.find(".leancloud-visitors-count");a&&a.text(r)}}))}))})).catch((function(t){}))}}};o.prototype.Q=function(t){var e=this,n=arguments.length,r=e.cfg.clazzName;if(1==n){var o=new AV.Query(r);o.doesNotExist("rid");var i=new AV.Query(r);i.equalTo("rid","");var a=AV.Query.or(o,i);return"*"===t?a.exists("url"):a.equalTo("url",decodeURI(t)),a.addDescending("createdAt"),a.addDescending("insertedAt"),a}var s=JSON.stringify(arguments[1]).replace(/(\[|\])/g,""),u="select * from "+r+" where rid in ("+s+") order by -createdAt,-createdAt";return AV.Query.doCloudQuery(u)},o.prototype.installLocale=function(t,e){return this.i18n(t,e),this},o.prototype.setPath=function(t){return this.config.path=t,this},o.prototype.bind=function(){var t=this,e=t.$el.find(".vemojis"),n=t.$el.find(".vpreview"),r=t.$el.find(".vemoji-btn"),o=t.$el.find(".vpreview-btn"),i=t.$el.find(".veditor"),u=c.default.maps,p=!1;t.$emoji={show:function(){return!p&&function(t){var n=[];for(var r in u)u.hasOwnProperty(r)&&c.default.build(r)&&n.push('<i title="'+r+'" >'+c.default.build(r)+"</i>");e.html(n.join("")),p=!0,e.find("i").on("click",(function(t){t.preventDefault(),O(i[0]," :"+(0,v.default)(this).attr("title")+":")}))}(),t.$preview.hide(),e.show(),r.addClass("actived"),t.$emoji},hide:function(){return r.removeClass("actived"),e.hide(),t.$emoji}},t.$preview={show:function(){return b?(t.$emoji.hide(),o.addClass("actived"),n.html((0,m.default)(b)).show(),I()):t.$preview.hide(),t.$preview},hide:function(){return o.removeClass("actived"),n.hide().html(""),t.$preview}};var _=function(e){var r=e.val()||"";r||t.$preview.hide(),b!=r&&(b=r,o.hasClass("actived")>-1&&b!=n.html()&&n.html((0,m.default)(b)),I())};r.on("click",(function(e){r.hasClass("actived")?t.$emoji.hide():t.$emoji.show()})),o.on("click",(function(e){o.hasClass("actived")?t.$preview.hide():t.$preview.show()}));var E=t.cfg.meta,A={},k={veditor:"comment"};for(var C in E.forEach((function(t){k["v"+t]=t})),k)k.hasOwnProperty(C)&&function(){var e=k[C],n=t.$el.find("."+C);A[e]=n,n.on("input change blur propertychange",(function(r){t.cfg.enableQQ&&"blur"===r.type&&"nick"===e&&(n.val()&&!isNaN(n.val())?(0,d.fetchQQFn)(n.val(),(function(t){var e=t.nick||n.val(),r=t.qq+"@qq.com";(0,v.default)(".vnick").val(e),(0,v.default)(".vmail").val(r),y.nick=e,y.mail=r,y.QQAvatar=t.pic})):v.default.store.get(l.QQCacheKey)&&v.default.store.get(l.QQCacheKey).nick!=n.val()&&(v.default.store.remove(l.QQCacheKey),y.nick=n.val(),y.mail="",y.QQAvatar="")),"comment"===e?((0,s.default)(n[0]),D((function(t){_(n)}))()):y[e]=(0,g.default)(n.val().replace(/(^\s*)|(\s*$)/g,"").substring(0,35))}))}();var D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,n=void 0;return function(){var r=this,o=arguments;n&&clearTimeout(n),n=setTimeout((function(){t.apply(r,o)}),e)}},O=function(t,e){if(document.selection)t.focus(),document.selection.createRange().text=e,t.focus();else if(t.selectionStart||"0"==t.selectionStart){var n=t.selectionStart,r=t.selectionEnd,o=t.scrollTop;t.value=t.value.substring(0,n)+e+t.value.substring(r,t.value.length),t.focus(),t.selectionStart=n+e.length,t.selectionEnd=n+e.length,t.scrollTop=o}else t.focus(),t.value+=e;D((function(e){_((0,v.default)(t))}))()},S={no:1,size:t.cfg.pageSize,skip:t.cfg.pageSize},$=t.$el.find(".vpage");$.on("click",(function(t){$.hide(),S.no++,j()}));var j=function(){var e=S.size,n=S.no,r=Number(t.$el.find(".vnum").text());t.$loading.show();var o=t.Q(t.cfg.path);o.limit(e),o.skip((n-1)*e),o.find().then((function(o){if(S.skip=S.size,o&&o.length){var i=[];o.forEach((function(e){i.push(e.id),P(e,t.$el.find(".vcards"),!0)})),t.Q(t.cfg.path,i).then((function(t){(t&&t.results||[]).forEach((function(t){P(t,(0,v.default)('.vquote[data-self-id="'+t.get("rid")+'"]'))}))})).catch((function(t){})),e*n<r?$.show():$.hide(),I()}else t.$nodata.show();t.$loading.hide()})).catch((function(e){t.$loading.hide(),(0,h.default)(t,e,"query")}))};t.Q(t.cfg.path).count().then((function(e){e>0?(t.$el.find(".vcount").show().find(".vnum").text(e),j()):t.$loading.hide()})).catch((function(e){(0,h.default)(t,e,"count")}));var T=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=/(https?|http):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g,n=t.match(e)||[];return n.length>0?n[0]:""},P=function(e,n,r){var o=(0,v.default)('<div class="vcard" id="'+e.id+'"></div>'),i=(0,g.default)(e.get("ua")),s="";i&&!/ja/.test(t.cfg.lang)&&(s=(i=v.default.detect(i)).version?i.os?'<span class="vsys">'+i.browser+" "+i.version+'</span> <span class="vsys">'+i.os+" "+i.osVersion+"</span>":"":'<span class="vsys">'+i.browser+"</span>"),"*"===t.cfg.path&&(s='<a href="'+e.get("url")+'" class="vsys">'+e.get("url")+"</a>");var u=e.get("link")?/^https?\:\/\//.test(e.get("link"))?e.get("link"):"http://"+e.get("link"):"",c=v.default.escape((0,g.default)(e.get("nick").substring(0,30))),l=u?'<a class="vnick" rel="nofollow" href="'+T(u)+'" target="_blank" >'+c+"</a>":'<span class="vnick">'+c+"</span>",p=(x.hide?"":t.cfg.enableQQ&&e.get("QQAvatar")?(0,g.default)('<img class="vimg" src="'+T(e.get("QQAvatar"))+'" referrerPolicy="no-referrer"/>'):'<img class="vimg" src="'+(x.cdn+(0,a.default)(e.get("mail"))+x.params)+'">')+'<div class="vh"><div class="vhead">'+l+" "+s+'</div><div class="vmeta"><span class="vtime" >'+(0,f.default)(e.get("insertedAt"),t.i18n)+'</span><span class="vat" data-vm-id="'+(e.get("rid")||e.id)+'" data-self-id="'+e.id+'">'+t.i18n.t("reply")+'</span></div><div class="vcontent" data-expand="'+t.i18n.t("expand")+'">'+(0,m.default)(e.get("comment"))+'</div><div class="vreply-wrapper" data-self-id="'+e.id+'"></div><div class="vquote" data-self-id="'+e.id+'"></div></div>';o.html(p);var d=o.find(".vat");o.find("a:not(.at)").forEach((function(t){(0,v.default)(t).attr({target:"_blank",rel:"noopener"})})),r?n.append(o):n.prepend(o);var h=o.find(".vcontent");h&&M(h),d&&F(d,e)},B={},F=function(e,n){e.on("click",(function(r){var o=e.attr("data-vm-id"),i=e.attr("data-self-id"),a=t.$el.find(".vwrap"),s="@"+v.default.escape(n.get("nick"));(0,v.default)('.vreply-wrapper[data-self-id="'+i+'"]').append(a).find(".cancel-reply").show(),B={at:v.default.escape(s)+" ",rid:o,pid:i,rmail:n.get("mail")},A.comment.attr({placeholder:s})[0].focus()}))},I=function(){setTimeout((function(){try{t.cfg.mathjax&&"MathJax"in window&&"version"in window.MathJax&&(/^3.*/.test(window.MathJax.version)&&MathJax.typeset()||MathJax.Hub.Queue(["Typeset",MathJax.Hub,document.querySelector(".v")])),"renderMathInElement"in window&&renderMathInElement((0,v.default)(".v")[0],{delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1}]})}catch(t){}}),100)},M=function(t){setTimeout((function(){t[0].offsetHeight>200&&(t.addClass("expand"),t.on("click",(function(e){t.removeClass("expand")})))}))};!function(e){if(e=v.default.store.get(l.MetaCacheKey)||e)for(var n in E)if(E.hasOwnProperty(n)){var r=E[n];t.$el.find(".v"+r).val(v.default.unescape(e[r])),y[r]=e[r]}var o=v.default.store.get(l.QQCacheKey);y.QQAvatar=t.cfg.enableQQ&&!!o&&o.pic||""}(),t.reset=function(){y.comment="",A.comment.val(""),_(A.comment),A.comment.attr("placeholder",t.cfg.placeholder),B={},t.$preview.hide(),t.$el.find(".vpanel").append(t.$el.find(".vwrap")),t.$el.find(".cancel-reply").hide(),b="",s.default.update(A.comment[0])};var R=t.$el.find(".vsubmit"),L=function(e){if(t.cfg.requiredFields.indexOf("nick")>-1&&y.nick.length<3)return A.nick[0].focus(),void t.$el.find(".status-bar").text(""+t.i18n.t("nickFail")).empty(3e3);if(t.cfg.requiredFields.indexOf("mail")>-1&&!/[\w-\.]+@([\w-]+\.)+[a-z]{2,3}/.test(y.mail))return A.mail[0].focus(),void t.$el.find(".status-bar").text(""+t.i18n.t("mailFail")).empty(3e3);if(""!=b){for(var n in w)if(w.hasOwnProperty(n)){var r=w[n];b=b.replace(n,r),URL.revokeObjectURL(n)}w={},y.comment=(0,g.default)(b),y.nick=y.nick||"Anonymous";var o=v.default.store.get("vlx");o&&Date.now()/1e3-o/1e3<20?t.$el.find(".status-bar").text(t.i18n.t("busy")).empty(3e3):z()}else A.comment[0].focus()},z=function(){v.default.store.set("vlx",Date.now()),R.attr({disabled:!0}),t.$loading.show(!0);var e=new(AV.Object.extend(t.cfg.clazzName||"Comment"));if(y.url=decodeURI(t.cfg.path),y.insertedAt=new Date,B.rid){var n=B.pid||B.rid;e.set("rid",B.rid),e.set("pid",n),y.comment=b.replace("<p>",'<p><a class="at" href="#'+n+'">'+B.at+"</a> , ")}for(var r in y)if(y.hasOwnProperty(r)){var o=y[r];e.set(r,o)}e.setACL(function(){var t=new AV.ACL;return t.setPublicReadAccess(!0),t.setPublicWriteAccess(!1),t}()),e.save().then((function(e){"Anonymous"!=y.nick&&v.default.store.set(l.MetaCacheKey,{nick:y.nick,link:y.link,mail:y.mail});var n=t.$el.find(".vnum");try{B.rid?P(e,(0,v.default)('.vquote[data-self-id="'+B.rid+'"]'),!0):(Number(n.text())?n.text(Number(n.text())+1):t.$el.find(".vcount").show().find(".vnum").text(Number(n.text())+1),P(e,t.$el.find(".vcards")),S.skip++),R.removeAttr("disabled"),t.$loading.hide(),t.reset()}catch(e){(0,h.default)(t,e,"save")}})).catch((function(e){(0,h.default)(t,e,"commitEvt")}))};R.on("click",L),(0,v.default)(document).on("keydown",(function(t){var e=(t=window.event||t).keyCode||t.which||t.charCode;(t.ctrlKey||t.metaKey)&&13===e&&L(),9===e&&"veditor"==(document.activeElement.id||"")&&(t.preventDefault(),O(i[0]," "))})).on("paste",(function(t){var e="clipboardData"in t?t.clipboardData:t.originalEvent&&t.originalEvent.clipboardData||window.clipboardData;e&&N(e.items,!0)})),i.on("dragenter dragleave dragover drop",(function(t){t.stopPropagation(),t.preventDefault(),"drop"===t.type&&N(t.dataTransfer.items)}));var N=function(t,e){for(var n=0,r=t.length;n<r;n++){var o=t[n];if("string"===o.kind&&o.type.match("^text/html"))!e&&o.getAsString((function(t){t&&O(i[0],t.replace(/<[^>]+>/g,""))}));else if(o.type.indexOf("image")>-1){U(o.getAsFile());continue}}},U=function(t){try{var e=URL.createObjectURL(t),n="![image]("+e+") ",r=new FileReader;O(i[0],n),r.onload=function(){w[e]=r.result},r.readAsDataURL(t)}catch(t){}}},t.exports=i,t.exports.default=i},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(3));e.default={getApi:function(t,e){r.default.ajax({url:"https://app-router.com/2/route",body:{appId:t}}).then((function(t){t.json().then((function(t){return e&&e("//"+t.api_server)}))}))}}},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(3)),o=!1;e.default=function(t,e){if("AV"in window){var n=window.AV.version||window.AV.VERSION;parseInt(n.split(".")[0])>2?o=!!AV.applicationId&&!!AV.applicationKey:r.default.deleteInWin("AV",0)}o?e&&e():r.default.sdkLoader("//unpkg.com/leancloud-storage@3/dist/av-min.js","AV",(function(n){var r,i="https://",a=t.app_id||t.appId,s=t.app_key||t.appKey;if(!t.serverURLs)switch(a.slice(-9)){case"-9Nh9j0Va":i+="tab.";break;case"-MdYXbMMI":i+="us."}r=t.serverURLs||i+"leancloud.cn",AV.init({appId:a,appKey:s,serverURLs:r}),o=!0,e&&e()}))}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=r(n(84)),i=r(n(100)),a=r(n(101)),s=r(n(98)),u=r(n(99)),c={zh:i.default,"zh-cn":i.default,"zh-CN":i.default,"zh-TW":a.default,en:s.default,"en-US":s.default,ja:u.default,"ja-JP":u.default};e.default=function(t,e){return!c[t]&&t&&e&&(c[t]=e),new o.default({phrases:c[t||"zh"],locale:t})}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(t.$el&&t.$loading.hide().$nodata.hide(),"[object Error]"==={}.toString.call(e)){var n=e.code||e.message||e.error||"";if(isNaN(n))t.$el&&t.$nodata.show('<pre style="text-align:left;"> '+JSON.stringify(e)+"</pre>");else{var r=t.i18n.t("code-"+n),o=(r=="code-"+n?void 0:r)||e.message||e.error||"";101==n||-1==n?t.$nodata.show():t.$el&&t.$nodata.show('<pre style="text-align:left;">Code '+n+": "+o+"</pre>")}}else t.$el&&t.$nodata.show('<pre style="text-align:left;">'+JSON.stringify(e)+"</pre>")}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var o=n(83),i=r(n(79)),a=r(n(3)),s=r(n(12)),u=r(n(13)),c=new o.marked.Renderer;c.code=function(t,e){return'<pre><code class="hljs language-'+e+'">'+(e&&hljs.getLanguage(e)?hljs.highlight(e,t).value:a.default.escape(t))+"</code></pre>"},o.marked.setOptions({renderer:"hljs"in window?c:new o.marked.Renderer,highlight:function(t,e){return"hljs"in window?e&&hljs.getLanguage(e)&&hljs.highlight(e,t,!0).value||hljs.highlightAuto(t).value:(0,i.default)(t)},gfm:!0,tables:!0,breaks:!0,pedantic:!1,sanitize:!1,smartLists:!0,smartypants:!0,headerPrefix:"v-"}),e.default=function(t){return(0,u.default)((0,o.marked)(s.default.parse(t,!0)))}},function(t,e,n){"use strict";e.__esModule=!0,e.recordIPFn=e.fetchQQFn=void 0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(3)),o=n(6);e.fetchQQFn=function(t,e){var n=r.default.store.get(o.QQCacheKey);n&&n.qq==t?e&&e(n):r.default.ajax({url:"//valine.api.ioliu.cn/getqqinfo",method:"POST",body:{qq:t}}).then((function(t){t.json().then((function(t){t.errmsg||(r.default.store.set(o.QQCacheKey,t),e&&e(t))}))}))},e.recordIPFn=function(t){r.default.ajax({url:"https://forge.speedtest.cn/api/location/info",method:"get"}).then((function(t){return t.json()})).then((function(e){t&&t(e.ip)}))}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!t)return"Invalid Date.";try{var n=o(t).getTime();if(isNaN(n))return"Invalid Date.";var i=(new Date).getTime()-n,a=Math.floor(i/864e5);if(0===a){var s=i%864e5,u=Math.floor(s/36e5);if(0===u){var c=s%36e5,l=Math.floor(c/6e4);if(0===l){var f=c%6e4;return Math.round(f/1e3)+" "+e.t("seconds")}return l+" "+e.t("minutes")}return u+" "+e.t("hours")}return a<0?e.t("now"):a<8?a+" "+e.t("days"):r(t)}catch(t){}};var r=function(t){var e=i(t.getDate(),2),n=i(t.getMonth()+1,2);return i(t.getFullYear(),2)+"-"+n+"-"+e},o=function t(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):/GMT/.test(e||"")?t(new Date(e).getTime()):(e=(e||"").replace(/(^\s*)|(\s*$)/g,"").replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(e))},i=function(t,e){for(var n=t.toString();n.length<e;)n="0"+n;return n}},function(t,e,n){var r;!function(o){"use strict";function i(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function a(t,e,n,r,o,a){return i(function(t,e){return t<<e|t>>>32-e}(i(i(e,t),i(r,a)),o),n)}function s(t,e,n,r,o,i,s){return a(e&n|~e&r,t,e,o,i,s)}function u(t,e,n,r,o,i,s){return a(e&r|n&~r,t,e,o,i,s)}function c(t,e,n,r,o,i,s){return a(e^n^r,t,e,o,i,s)}function l(t,e,n,r,o,i,s){return a(n^(e|~r),t,e,o,i,s)}function f(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;var n,r,o,a,f,p=1732584193,d=-271733879,h=-1732584194,v=271733878;for(n=0;n<t.length;n+=16)r=p,o=d,a=h,f=v,p=s(p,d,h,v,t[n],7,-680876936),v=s(v,p,d,h,t[n+1],12,-389564586),h=s(h,v,p,d,t[n+2],17,606105819),d=s(d,h,v,p,t[n+3],22,-1044525330),p=s(p,d,h,v,t[n+4],7,-176418897),v=s(v,p,d,h,t[n+5],12,1200080426),h=s(h,v,p,d,t[n+6],17,-1473231341),d=s(d,h,v,p,t[n+7],22,-45705983),p=s(p,d,h,v,t[n+8],7,1770035416),v=s(v,p,d,h,t[n+9],12,-1958414417),h=s(h,v,p,d,t[n+10],17,-42063),d=s(d,h,v,p,t[n+11],22,-1990404162),p=s(p,d,h,v,t[n+12],7,1804603682),v=s(v,p,d,h,t[n+13],12,-40341101),h=s(h,v,p,d,t[n+14],17,-1502002290),p=u(p,d=s(d,h,v,p,t[n+15],22,1236535329),h,v,t[n+1],5,-165796510),v=u(v,p,d,h,t[n+6],9,-1069501632),h=u(h,v,p,d,t[n+11],14,643717713),d=u(d,h,v,p,t[n],20,-373897302),p=u(p,d,h,v,t[n+5],5,-701558691),v=u(v,p,d,h,t[n+10],9,38016083),h=u(h,v,p,d,t[n+15],14,-660478335),d=u(d,h,v,p,t[n+4],20,-405537848),p=u(p,d,h,v,t[n+9],5,568446438),v=u(v,p,d,h,t[n+14],9,-1019803690),h=u(h,v,p,d,t[n+3],14,-187363961),d=u(d,h,v,p,t[n+8],20,1163531501),p=u(p,d,h,v,t[n+13],5,-1444681467),v=u(v,p,d,h,t[n+2],9,-51403784),h=u(h,v,p,d,t[n+7],14,1735328473),p=c(p,d=u(d,h,v,p,t[n+12],20,-1926607734),h,v,t[n+5],4,-378558),v=c(v,p,d,h,t[n+8],11,-2022574463),h=c(h,v,p,d,t[n+11],16,1839030562),d=c(d,h,v,p,t[n+14],23,-35309556),p=c(p,d,h,v,t[n+1],4,-1530992060),v=c(v,p,d,h,t[n+4],11,1272893353),h=c(h,v,p,d,t[n+7],16,-155497632),d=c(d,h,v,p,t[n+10],23,-1094730640),p=c(p,d,h,v,t[n+13],4,681279174),v=c(v,p,d,h,t[n],11,-358537222),h=c(h,v,p,d,t[n+3],16,-722521979),d=c(d,h,v,p,t[n+6],23,76029189),p=c(p,d,h,v,t[n+9],4,-640364487),v=c(v,p,d,h,t[n+12],11,-421815835),h=c(h,v,p,d,t[n+15],16,530742520),p=l(p,d=c(d,h,v,p,t[n+2],23,-995338651),h,v,t[n],6,-198630844),v=l(v,p,d,h,t[n+7],10,1126891415),h=l(h,v,p,d,t[n+14],15,-1416354905),d=l(d,h,v,p,t[n+5],21,-57434055),p=l(p,d,h,v,t[n+12],6,1700485571),v=l(v,p,d,h,t[n+3],10,-1894986606),h=l(h,v,p,d,t[n+10],15,-1051523),d=l(d,h,v,p,t[n+1],21,-2054922799),p=l(p,d,h,v,t[n+8],6,1873313359),v=l(v,p,d,h,t[n+15],10,-30611744),h=l(h,v,p,d,t[n+6],15,-1560198380),d=l(d,h,v,p,t[n+13],21,1309151649),p=l(p,d,h,v,t[n+4],6,-145523070),v=l(v,p,d,h,t[n+11],10,-1120210379),h=l(h,v,p,d,t[n+2],15,718787259),d=l(d,h,v,p,t[n+9],21,-343485551),p=i(p,r),d=i(d,o),h=i(h,a),v=i(v,f);return[p,d,h,v]}function p(t){var e,n="",r=32*t.length;for(e=0;e<r;e+=8)n+=String.fromCharCode(t[e>>5]>>>e%32&255);return n}function d(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function h(t){var e,n,r="0123456789abcdef",o="";for(n=0;n<t.length;n+=1)e=t.charCodeAt(n),o+=r.charAt(e>>>4&15)+r.charAt(15&e);return o}function v(t){return unescape(encodeURIComponent(t))}function m(t){return function(t){return p(f(d(t),8*t.length))}(v(t))}function g(t,e){return function(t,e){var n,r,o=d(t),i=[],a=[];for(i[15]=a[15]=void 0,o.length>16&&(o=f(o,8*t.length)),n=0;n<16;n+=1)i[n]=909522486^o[n],a[n]=1549556828^o[n];return r=f(i.concat(d(e)),512+8*e.length),p(f(a.concat(r),640))}(v(t),v(e))}function y(t,e,n){return e?n?g(e,t):function(t,e){return h(g(t,e))}(e,t):n?m(t):function(t){return h(m(t))}(t)}void 0!==(r=function(){return y}.call(e,n,e,t))&&(t.exports=r)}()},function(t,e,n){"use strict";var r=n(2),o=n(4),i=n(1),a=n(5),s=n(14),u=n(15),c=u(),l=n(44),f=i("Array.prototype.slice"),p=o.apply(c),d=function(t,e){return a(t),p(t,f(arguments,1))};r(d,{getPolyfill:u,implementation:s,shim:l}),t.exports=d},function(t,e,n){"use strict";var r=n(2),o=n(15);t.exports=function(){var t=o();return r(Array.prototype,{forEach:t},{forEach:function(){return Array.prototype.forEach!==t}}),t}},function(t,e,n){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n(47));e.default=function(t){return t=(0,r.default)({url:"",method:"get",body:{}},t),new Promise((function(e,n){if("jsonp"==t.method){var r="cb_"+(Date.now()+Math.round(1e3*Math.random())).toString(32),o=document,a=o.body,s=o.createElement("script");return s.async=!0,s.defer=!0,t.url.indexOf("?")>-1?t.url+="&"+i({callback:r,t:Date.now()}):t.url+="?"+i({callback:r,t:Date.now()}),s.src=t.url,window[r]=function(t){window[r]=null,a.removeChild(s),e(t)},void a.appendChild(s)}var u="XMLHttpRequest"in window?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),c=[],l=[],f={};for(var p in i(t.body)&&(t.url=t.url+"?"+("get"==t.method?i(t.body):"")),u.open(t.method||"get",t.url),"blob"==t.dataType&&(u.responseType="blob"),u.onload=function(){u.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){c.push(e=e.toLowerCase()),l.push([e,n]),f[e]=f[e]?f[e]+","+n:n})),e(function t(){return{ok:2==(u.status/100|0),statusText:u.statusText,status:u.status,url:u.responseURL,text:function(){return Promise.resolve(u.responseText)},json:function(){return Promise.resolve(u.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([u.response]))},clone:t,headers:{keys:function(){return c},entries:function(){return l},get:function(t){return f[t.toLowerCase()]},has:function(t){return t.toLowerCase()in f}}}}())},u.onerror=n,u.withCredentials="include"==t.credentials,t.headers)u.setRequestHeader(p,t.headers[p]);u.send("post"==t.method?t.body:"get"==t.method?"":i(t.body))}))};var o=encodeURIComponent,i=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(o(n)+"="+o(t[n]));return(e=e.join("&").replace(/%20/g,"+"))||""}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){var e={},n={Trident:(t=t||navigator.userAgent).indexOf("Trident")>-1||t.indexOf("NET CLR")>-1,Presto:t.indexOf("Presto")>-1,WebKit:t.indexOf("AppleWebKit")>-1,Gecko:t.indexOf("Gecko/")>-1,Safari:t.indexOf("Safari")>-1,Edge:t.indexOf("Edge")>-1||t.indexOf("Edg")>-1,Chrome:t.indexOf("Chrome")>-1||t.indexOf("CriOS")>-1,IE:t.indexOf("MSIE")>-1||t.indexOf("Trident")>-1,Firefox:t.indexOf("Firefox")>-1||t.indexOf("FxiOS")>-1,"Firefox Focus":t.indexOf("Focus")>-1,Chromium:t.indexOf("Chromium")>-1,Opera:t.indexOf("Opera")>-1||t.indexOf("OPR")>-1,Vivaldi:t.indexOf("Vivaldi")>-1,Yandex:t.indexOf("YaBrowser")>-1,Kindle:t.indexOf("Kindle")>-1||t.indexOf("Silk/")>-1,360:t.indexOf("360EE")>-1||t.indexOf("360SE")>-1,UC:t.indexOf("UC")>-1||t.indexOf(" UBrowser")>-1,QQBrowser:t.indexOf("QQBrowser")>-1,QQ:t.indexOf("QQ/")>-1,Baidu:t.indexOf("Baidu")>-1||t.indexOf("BIDUBrowser")>-1,Maxthon:t.indexOf("Maxthon")>-1,Sogou:t.indexOf("MetaSr")>-1||t.indexOf("Sogou")>-1,LBBROWSER:t.indexOf("LBBROWSER")>-1,"2345Explorer":t.indexOf("2345Explorer")>-1,TheWorld:t.indexOf("TheWorld")>-1,XiaoMi:t.indexOf("MiuiBrowser")>-1,Quark:t.indexOf("Quark")>-1,Qiyu:t.indexOf("Qiyu")>-1,Wechat:t.indexOf("MicroMessenger")>-1,Taobao:t.indexOf("AliApp(TB")>-1,Alipay:t.indexOf("AliApp(AP")>-1,Weibo:t.indexOf("Weibo")>-1,Douban:t.indexOf("com.douban.frodo")>-1,Suning:t.indexOf("SNEBUY-APP")>-1,iQiYi:t.indexOf("IqiyiApp")>-1,Windows:t.indexOf("Windows")>-1,Linux:t.indexOf("Linux")>-1||t.indexOf("X11")>-1,macOS:t.indexOf("Macintosh")>-1,Android:t.indexOf("Android")>-1||t.indexOf("Adr")>-1,Ubuntu:t.indexOf("Ubuntu")>-1,FreeBSD:t.indexOf("FreeBSD")>-1,Debian:t.indexOf("Debian")>-1,"Windows Phone":t.indexOf("IEMobile")>-1||t.indexOf("Windows Phone")>-1,BlackBerry:t.indexOf("BlackBerry")>-1||t.indexOf("RIM")>-1||t.indexOf("BB10")>-1,MeeGo:t.indexOf("MeeGo")>-1,Symbian:t.indexOf("Symbian")>-1,iOS:t.indexOf("like Mac OS X")>-1,"Chrome OS":t.indexOf("CrOS")>-1,WebOS:t.indexOf("hpwOS")>-1,Mobile:t.indexOf("Mobi")>-1||t.indexOf("iPh")>-1||t.indexOf("480")>-1,Tablet:t.indexOf("Tablet")>-1||t.indexOf("Pad")>-1||t.indexOf("Nexus 7")>-1};n.Mobile&&(n.Mobile=!(t.indexOf("iPad")>-1));var r={browser:["Safari","Chrome","Edge","IE","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Kindle","360","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Linux","Mac OS","macOS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"]};for(var o in r)if(r.hasOwnProperty(o))for(var i=0,a=r[o].length;i<a;i++){var s=r[o][i];n[s]&&(e[o]=s)}var u={Windows:function(){return{"10.0":"11",6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[t.replace(/^.*Windows NT ([\d.]+).*$/,"$1")]},Android:t.replace(/^.*Android ([\d.]+);.*$/,"$1"),iOS:t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,"."),Debian:t.replace(/^.*Debian\/([\d.]+).*$/,"$1"),"Windows Phone":t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2"),macOS:t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,"."),WebOS:t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1"),BlackBerry:t.replace(/^.*BB([\d.]+);*$/,"$1")};e.osVersion="";var c=u[e.os];c&&(e.osVersion="function"==typeof c?c():c==t?"":c);var l={Safari:t.replace(/^.*Version\/([\d.]+).*$/,"$1"),Chrome:t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1"),IE:t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1"),Edge:t.replace(/^.*Edge?\/([\d.]+).*$/,"$1"),Firefox:t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1"),"Firefox Focus":t.replace(/^.*Focus\/([\d.]+).*$/,"$1"),Chromium:t.replace(/^.*Chromium\/([\d.]+).*$/,"$1"),Opera:t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1"),Vivaldi:t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1"),Yandex:t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1"),Kindle:t.replace(/^.*Version\/([\d.]+).*$/,"$1"),Maxthon:t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1"),QQBrowser:t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1"),QQ:t.replace(/^.*QQ\/([\d.]+).*$/,"$1"),Baidu:t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1"),UC:t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1"),Sogou:t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1"),"2345Explorer":t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1"),TheWorld:t.replace(/^.*TheWorld ([\d.]+).*$/,"$1"),XiaoMi:t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1"),Quark:t.replace(/^.*Quark\/([\d.]+).*$/,"$1"),Qiyu:t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1"),Wechat:t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1"),Taobao:t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1"),Alipay:t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1"),Weibo:t.replace(/^.*weibo__([\d.]+).*$/,"$1"),Douban:t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1"),Suning:t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1"),iQiYi:t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")};e.version="";var f=l[e.browser];return f&&(e.version="function"==typeof f?f():f==t?"":f),null==e.browser&&(e.browser="Unknow App"),e}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){t=Object(t);for(var e=1,n=arguments.length;e<n;e++){var r=arguments[e];if(r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t}},function(t,e,n){"use strict";function r(t){return/^\{[\s\S]*\}$/.test(JSON.stringify(t))}function o(t){return"[object Function]"==={}.toString.call(t)}function i(t){return"[object Array]"==={}.toString.call(t)}function a(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t}}function s(){if(!(this instanceof s))return new s}function u(t,e){var n=arguments,a=null;if(l||(l=s()),0===n.length)return l.get();if(1===n.length){if("string"==typeof t)return l.get(t);if(r(t))return l.set(t)}if(2===n.length&&"string"==typeof t){if(!e)return l.remove(t);if(e&&"string"==typeof e)return l.set(t,e);e&&o(e)&&(a=null,a=e(t,l.get(t)),u.set(t,a))}if(2===n.length&&i(t)&&o(e))for(var c=0,f=t.length;c<f;c++)a=e(t[c],l.get(t[c])),u.set(t[c],a);return u}e.__esModule=!0;var c=window.localStorage;c=function(t){var e="_Is_Incognit";try{t.setItem(e,"yes")}catch(e){if(["QuotaExceededError","NS_ERROR_DOM_QUOTA_REACHED"].indexOf(e.name)>-1){var n=function(){};t.__proto__={setItem:n,getItem:n,removeItem:n,clear:n}}}finally{"yes"===t.getItem(e)&&t.removeItem(e)}return t}(c),s.prototype={set:function(t,e){if(t&&!r(t))c.setItem(t,function(t){return void 0===t||"function"==typeof t?t+"":JSON.stringify(t)}(e));else if(r(t))for(var n in t)this.set(n,t[n]);return this},get:function(t){if(!t){var e={};return this.each((function(t,n){return e[t]=n})),e}if("?"===t.charAt(0))return this.has(t.substr(1));var n=arguments;if(n.length>1){for(var r={},o=0,i=n.length;o<i;o++){var s=a(c.getItem(n[o]));s&&(r[n[o]]=s)}return r}return a(c.getItem(t))},clear:function(){return c.clear(),this},remove:function(t){var e=this.get(t);return c.removeItem(t),e},has:function(t){return{}.hasOwnProperty.call(this.get(),t)},keys:function(){var t=[];return this.each((function(e){t.push(e)})),t},each:function(t){for(var e=0,n=c.length;e<n;e++){var r=c.key(e);t(r,this.get(r))}return this},search:function(t){for(var e=this.keys(),n={},r=0,o=e.length;r<o;r++)e[r].indexOf(t)>-1&&(n[e[r]]=this.get(e[r]));return n}};var l=null;for(var f in s.prototype)u[f]=s.prototype[f];e.default=u},function(t,e,n){var r,o;o=function(t,e,n){function r(e,o,i){return i=Object.create(r.fn),e&&i.push.apply(i,e.addEventListener?[e]:""+e===e?/</.test(e)?((o=t.createElement(o)).innerHTML=e,o.children):o?(o=r(o)[0])?o[n](e):i:t[n](e):e),i}return r.fn=[],r.one=function(t,e){return r(t,e)[0]||null},r}(document,0,"querySelectorAll"),void 0!==(r=function(){return o}.apply(e,[]))&&(t.exports=r)},function(t,e,n){function r(t){return null==t}function o(t){(t=function(t){var e={};for(var n in t)e[n]=t[n];return e}(t||{})).whiteList=t.whiteList||i.whiteList,t.onAttr=t.onAttr||i.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||i.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||i.safeAttrValue,this.options=t}var i=n(16),a=n(51);n(17),o.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,n=e.whiteList,o=e.onAttr,i=e.onIgnoreAttr,s=e.safeAttrValue;return a(t,(function(t,e,a,u,c){var l=n[a],f=!1;if(!0===l?f=l:"function"==typeof l?f=l(u):l instanceof RegExp&&(f=l.test(u)),!0!==f&&(f=!1),u=s(a,u)){var p,d={position:e,sourcePosition:t,source:c,isWhite:f};return f?r(p=o(a,u,d))?a+":"+u:p:r(p=i(a,u,d))?void 0:p}}))},t.exports=o},function(t,e,n){var r=n(17);t.exports=function(t,e){function n(){if(!i){var n=r.trim(t.slice(a,s)),o=n.indexOf(":");if(-1!==o){var c=r.trim(n.slice(0,o)),l=r.trim(n.slice(o+1));if(c){var f=e(a,u.length,c,l,n);f&&(u+=f+"; ")}}}a=s+1}";"!==(t=r.trimRight(t))[t.length-1]&&(t+=";");for(var o=t.length,i=!1,a=0,s=0,u="";s<o;s++){var c=t[s];if("/"===c&&"*"===t[s+1]){var l=t.indexOf("*/",s+2);if(-1===l)break;a=(s=l+1)+1,i=!1}else"("===c?i=!0:")"===c?i=!1:";"===c?i||n():"\n"===c&&n()}return r.trim(u)}},function(t,e,n){"use strict";var r=n(0),o=n(1),i=r("%TypeError%"),a=n(54),s=r("%Reflect.apply%",!0)||o("%Function.prototype.apply%");t.exports=function(t,e){var n=arguments.length>2?arguments[2]:[];if(!a(n))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,n)}},function(t,e,n){"use strict";var r=n(0)("%TypeError%"),o=n(19),i=n(8);t.exports=function(t,e){if("Object"!==i(t))throw new r("Assertion failed: `O` must be an Object");if(!o(e))throw new r("Assertion failed: `P` must be a Property Key");return e in t}},function(t,e,n){"use strict";var r=n(0)("%Array%"),o=!r.isArray&&n(1)("Object.prototype.toString");t.exports=r.isArray||function(t){return"[object Array]"===o(t)}},function(t,e,n){"use strict";t.exports=n(10)},function(t,e,n){"use strict";var r=n(0)("%TypeError%"),o=n(18),i=n(58),a=n(8);t.exports=function(t){if("Object"!==a(t))throw new r("Assertion failed: `obj` must be an Object");return i(o(t,"length"))}},function(t,e,n){"use strict";var r=n(63),o=n(59);t.exports=function(t){var e=o(t);return 0!==e&&(e=r(e)),0===e?0:e}},function(t,e,n){"use strict";var r=n(72),o=n(57);t.exports=function(t){var e=o(t);return e<=0?0:e>r?r:e}},function(t,e,n){"use strict";var r=n(0),o=r("%TypeError%"),i=r("%Number%"),a=r("%RegExp%"),s=r("%parseInt%"),u=n(1),c=n(73),l=n(71),f=u("String.prototype.slice"),p=c(/^0b[01]+$/i),d=c(/^0o[0-7]+$/i),h=c(/^[-+]0x[0-9a-f]+$/i),v=c(new a("["+["…","​","￾"].join("")+"]","g")),m=["\t\n\v\f\r   ᠎    ","          \u2028","\u2029\ufeff"].join(""),g=new RegExp("(^["+m+"]+)|(["+m+"]+$)","g"),y=u("String.prototype.replace"),b=n(61);t.exports=function t(e){var n=l(e)?e:b(e,i);if("symbol"==typeof n)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof n)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");if("string"==typeof n){if(p(n))return t(s(f(n,2),2));if(d(n))return t(s(f(n,2),8));if(v(n)||h(n))return NaN;var r=function(t){return y(t,g,"")}(n);if(r!==n)return t(r)}return i(n)}},function(t,e,n){"use strict";var r=n(0)("%Object%"),o=n(5);t.exports=function(t){return o(t),r(t)}},function(t,e,n){"use strict";var r=n(76);t.exports=function(t){return arguments.length>1?r(t,arguments[1]):r(t)}},function(t,e,n){"use strict";var r=n(0)("%TypeError%");t.exports=function(t,e){if(null==t)throw new r(e||"Cannot call method on "+t);return t}},function(t,e,n){"use strict";var r=n(67),o=n(68),i=n(64),a=n(70),s=n(69),u=n(74);t.exports=function(t){var e=i(t);return a(e)?0:0!==e&&s(e)?u(e)*o(r(e)):e}},function(t,e,n){"use strict";var r=n(65);t.exports=function(t){var e=r(t,Number);if("string"!=typeof e)return+e;var n=e.replace(/^[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+|[ \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u0085]+$/g,"");return/^0[ob]|^[+-]0x/.test(n)?NaN:+n}},function(t,e,n){"use strict";t.exports=n(77)},function(t,e,n){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},function(t,e,n){"use strict";var r=n(0)("%Math.abs%");t.exports=function(t){return r(t)}},function(t,e,n){"use strict";var r=Math.floor;t.exports=function(t){return r(t)}},function(t,e,n){"use strict";var r=Number.isNaN||function(t){return t!=t};t.exports=Number.isFinite||function(t){return"number"==typeof t&&!r(t)&&t!==1/0&&t!==-1/0}},function(t,e,n){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},function(t,e,n){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},function(t,e,n){"use strict";var r=n(0),o=r("%Math%"),i=r("%Number%");t.exports=i.MAX_SAFE_INTEGER||o.pow(2,53)-1},function(t,e,n){"use strict";var r=n(0)("RegExp.prototype.test"),o=n(4);t.exports=function(t){return o(r,t)}},function(t,e,n){"use strict";t.exports=function(t){return t>=0?1:-1}},function(t,e){t.exports=function(t){var e=!0,n=!0,r=!1;if("function"==typeof t){try{t.call("f",(function(t,n,r){"object"!=typeof r&&(e=!1)})),t.call([null],(function(){"use strict";n="string"==typeof this}),"x")}catch(t){r=!0}return!r&&e&&n}return!1}},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=n(21),i=n(10),a=n(80),s=n(82),u=function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var n,r,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<s.length;++a)if(n=t[s[a]],i(n)&&(r=n.call(t),o(r)))return r;throw new TypeError("No default value")},c=function(t,e){var n=t[e];if(null!=n){if(!i(n))throw new TypeError(n+" returned for property "+e+" of object "+t+" is not a function");return n}};t.exports=function(t){if(o(t))return t;var e,n="default";if(arguments.length>1&&(arguments[1]===String?n="string":arguments[1]===Number&&(n="number")),r&&(Symbol.toPrimitive?e=c(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var i=e.call(t,n);if(o(i))return i;throw new TypeError("unable to convert exotic object to primitive")}return"default"===n&&(a(t)||s(t))&&(n="string"),u(t,"default"===n?"number":n)}},function(t,e,n){"use strict";var r=Object.prototype.toString,o=n(21),i=n(10),a=function(t){var e;if((e=arguments.length>1?arguments[1]:"[object Date]"===r.call(t)?String:Number)===String||e===Number){var n,a,s=e===String?["toString","valueOf"]:["valueOf","toString"];for(a=0;a<s.length;++a)if(i(t[s[a]])&&(n=t[s[a]](),o(n)))return n;throw new TypeError("No default value")}throw new TypeError("invalid [[DefaultValue]] hint supplied")};t.exports=function(t){return o(t)?t:arguments.length>1?a(t,arguments[1]):a(t)}},function(t,e,n){"use strict";var r=Array.prototype.slice,o=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,i=r.call(arguments,1),a=function(){if(this instanceof n){var o=e.apply(this,i.concat(r.call(arguments)));return Object(o)===o?o:this}return e.apply(t,i.concat(r.call(arguments)))},s=Math.max(0,e.length-i.length),u=[],c=0;c<s;c++)u.push("$"+c);if(n=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(a),e.prototype){var l=function(){};l.prototype=e.prototype,n.prototype=new l,l.prototype=null}return n}},function(t,e,n){t.exports=function(){"use strict";var t=function(t,e){return function(t){var e=t.exports=function(){return new RegExp("(?:"+e.line().source+")|(?:"+e.block().source+")","gm")};e.line=function(){return/(?:^|\s)\/\/(.+?)$/gm},e.block=function(){return/\/\*([\S\s]*?)\*\//gm}}(e={exports:{}}),e.exports}(),e=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"];return function(n,r){void 0===r&&(r={});var o=r.colors;void 0===o&&(o=e);var i=0,a={},s=new RegExp("("+/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/.source+"|"+/</.source+")|("+t().source+")","gmi");return n.replace(s,(function(t,e,n){if(n)return function(t){return'<span style="color: slategray">'+t+"</span>"}(n);if("<"===e)return"<";var r;a[e]?r=a[e]:(r=o[i],a[e]=r);var s='<span style="color: #'+r+'">'+e+"</span>";return i=++i%o.length,s}))}}()},function(t,e,n){"use strict";var r=Date.prototype.getDay,o=Object.prototype.toString,i=n(24)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},function(t,e,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i=n(24)();t.exports=function(t){return"string"==typeof t||"object"==typeof t&&(i?function(t){try{return r.call(t),!0}catch(t){return!1}}(t):"[object String]"===o.call(t))}},function(t,e,n){"use strict";var r=Object.prototype.toString;if(n(22)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==r.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},function(t,e,n){!function(t){"use strict";function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function n(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=r(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function s(e){t.defaults=e}function u(t,e){if(e){if(x.test(t))return t.replace(_,C)}else if(E.test(t))return t.replace(A,C);return t}function c(t){return t.replace(D,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}function l(t,e){t=t.source||t,e=e||"";var n={replace:function(e,r){return r=(r=r.source||r).replace(O,"$1"),t=t.replace(e,r),n},getRegex:function(){return new RegExp(t,e)}};return n}function f(t,e,n){if(t){var r;try{r=decodeURIComponent(c(n)).replace(S,"").toLowerCase()}catch(t){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}e&&!$.test(n)&&(n=function(t,e){j[" "+t]||(T.test(t)?j[" "+t]=t+"/":j[" "+t]=h(t,"/",!0));var n=-1===(t=j[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(P,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(B,"$1")+e:t+e}(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n}function p(t){for(var e,n,r=1;r<arguments.length;r++)for(n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function d(t,e){var n=t.replace(/\|/g,(function(t,e,n){for(var r=!1,o=e;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function h(t,e,n){var r=t.length;if(0===r)return"";for(var o=0;o<r;){var i=t.charAt(r-o-1);if(i!==e||n){if(i===e||!n)break;o++}else o++}return t.substr(0,r-o)}function v(t){t&&t.sanitize&&t.silent}function m(t,e){if(e<1)return"";for(var n="";e>1;)1&e&&(n+=t),e>>=1,t+=t;return n+t}function g(t,e,n,r){var o=e.href,i=e.title?u(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if("!"!==t[0].charAt(0)){r.state.inLink=!0;var s={type:"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a,[])};return r.state.inLink=!1,s}return{type:"image",raw:n,href:o,title:i,text:u(a)}}function y(t){return t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function b(t){var e,n,r="",o=t.length;for(e=0;e<o;e++)n=t.charCodeAt(e),Math.random()>.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}function w(t,e,n){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if("function"==typeof e&&(n=e,e=null),v(e=p({},w.defaults,e||{})),n){var r,o=e.highlight;try{r=L.lex(t,e)}catch(t){return n(t)}var i=function(t){var i;if(!t)try{e.walkTokens&&w.walkTokens(r,e.walkTokens),i=V.parse(r,e)}catch(e){t=e}return e.highlight=o,t?n(t):n(null,i)};if(!o||o.length<3)return i();if(delete e.highlight,!r.length)return i();var a=0;return w.walkTokens(r,(function(t){"code"===t.type&&(a++,setTimeout((function(){o(t.text,t.lang,(function(e,n){if(e)return i(e);null!=n&&n!==t.text&&(t.text=n,t.escaped=!0),0==--a&&i()}))}),0))})),void(0===a&&i())}try{var s=L.lex(t,e);return e.walkTokens&&w.walkTokens(s,e.walkTokens),V.parse(s,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+u(t.message+"",!0)+"</pre>";throw t}}t.defaults={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};var x=/[&<>"']/,_=/[&<>"']/g,E=/[<>"']|&(?!#?\w+;)/,A=/[<>"']|&(?!#?\w+;)/g,k={"&":"&","<":"<",">":">",'"':""","'":"'"},C=function(t){return k[t]},D=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,O=/(^|[^\[])\^/g,S=/[^\w:]/g,$=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,j={},T=/^[^:]+:\/*[^/]*$/,P=/^([^:]+:)[\s\S]*$/,B=/^([^:]+:\/*[^/]*)[\s\S]*$/,F={exec:function(){}},I=function(){function e(e){this.options=e||t.defaults}var n=e.prototype;return n.space=function(t){var e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}},n.code=function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:h(n,"\n")}}},n.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],r=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var r=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=r.length?t.slice(r.length):t})).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:r}}},n.heading=function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var r=h(n,"#");this.options.pedantic?n=r.trim():r&&!/ $/.test(r)||(n=r.trim())}var o={type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:[]};return this.lexer.inline(o.text,o.tokens),o}},n.hr=function(t){var e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}},n.blockquote=function(t){var e=this.rules.block.blockquote.exec(t);if(e){var n=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],tokens:this.lexer.blockTokens(n,[]),text:n}}},n.list=function(t){var e=this.rules.block.list.exec(t);if(e){var n,r,o,a,s,u,c,l,f,p,d,h,v=e[1].trim(),m=v.length>1,g={type:"list",raw:"",ordered:m,start:m?+v.slice(0,-1):"",loose:!1,items:[]};v=m?"\\d{1,9}\\"+v.slice(-1):"\\"+v,this.options.pedantic&&(v=m?v:"[*+-]");for(var y=new RegExp("^( {0,3}"+v+")((?: [^\\n]*)?(?:\\n|$))");t&&(h=!1,e=y.exec(t))&&!this.rules.block.hr.test(t);){if(n=e[0],t=t.substring(n.length),l=e[2].split("\n",1)[0],f=t.split("\n",1)[0],this.options.pedantic?(a=2,d=l.trimLeft()):(a=(a=e[2].search(/[^ ]/))>4?1:a,d=l.slice(a),a+=e[1].length),u=!1,!l&&/^ *$/.test(f)&&(n+=f+"\n",t=t.substring(f.length+1),h=!0),!h)for(var b=new RegExp("^ {0,"+Math.min(3,a-1)+"}(?:[*+-]|\\d{1,9}[.)])");t&&(l=p=t.split("\n",1)[0],this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!b.test(l));){if(l.search(/[^ ]/)>=a||!l.trim())d+="\n"+l.slice(a);else{if(u)break;d+="\n"+l}u||l.trim()||(u=!0),n+=p+"\n",t=t.substring(p.length+1)}g.loose||(c?g.loose=!0:/\n *\n *$/.test(n)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(d))&&(o="[ ] "!==r[0],d=d.replace(/^\[[ xX]\] +/,"")),g.items.push({type:"list_item",raw:n,task:!!r,checked:o,loose:!1,text:d}),g.raw+=n}g.items[g.items.length-1].raw=n.trimRight(),g.items[g.items.length-1].text=d.trimRight(),g.raw=g.raw.trimRight();var w=g.items.length;for(s=0;s<w;s++){this.lexer.state.top=!1,g.items[s].tokens=this.lexer.blockTokens(g.items[s].text,[]);var x=g.items[s].tokens.filter((function(t){return"space"===t.type})),_=x.every((function(t){for(var e,n=0,r=i(t.raw.split(""));!(e=r()).done;)if("\n"===e.value&&(n+=1),n>1)return!0;return!1}));!g.loose&&x.length&&_&&(g.loose=!0,g.items[s].loose=!0)}return g}},n.html=function(t){var e=this.rules.block.html.exec(t);if(e){var n={type:"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:e[0]};return this.options.sanitize&&(n.type="paragraph",n.text=this.options.sanitizer?this.options.sanitizer(e[0]):u(e[0]),n.tokens=[],this.lexer.inline(n.text,n.tokens)),n}},n.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{type:"def",tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},n.table=function(t){var e=this.rules.block.table.exec(t);if(e){var n={type:"table",header:d(e[1]).map((function(t){return{text:t}})),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=e[0];var r,o,i,a,s=n.align.length;for(r=0;r<s;r++)/^ *-+: *$/.test(n.align[r])?n.align[r]="right":/^ *:-+: *$/.test(n.align[r])?n.align[r]="center":/^ *:-+ *$/.test(n.align[r])?n.align[r]="left":n.align[r]=null;for(s=n.rows.length,r=0;r<s;r++)n.rows[r]=d(n.rows[r],n.header.length).map((function(t){return{text:t}}));for(s=n.header.length,o=0;o<s;o++)n.header[o].tokens=[],this.lexer.inlineTokens(n.header[o].text,n.header[o].tokens);for(s=n.rows.length,o=0;o<s;o++)for(a=n.rows[o],i=0;i<a.length;i++)a[i].tokens=[],this.lexer.inlineTokens(a[i].text,a[i].tokens);return n}}},n.lheading=function(t){var e=this.rules.block.lheading.exec(t);if(e){var n={type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}},n.paragraph=function(t){var e=this.rules.block.paragraph.exec(t);if(e){var n={type:"paragraph",raw:e[0],text:"\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}},n.text=function(t){var e=this.rules.block.text.exec(t);if(e){var n={type:"text",raw:e[0],text:e[0],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}},n.escape=function(t){var e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:u(e[1])}},n.tag=function(t){var e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):u(e[0]):e[0]}},n.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var r=h(n.slice(0,-1),"\\");if((n.length-r.length)%2==0)return}else{var o=function(t,e){if(-1===t.indexOf(e[1]))return-1;for(var n=t.length,r=0,o=0;o<n;o++)if("\\"===t[o])o++;else if(t[o]===e[0])r++;else if(t[o]===e[1]&&--r<0)return o;return-1}(e[2],"()");if(o>-1){var i=(0===e[0].indexOf("!")?5:4)+e[1].length+o;e[2]=e[2].substring(0,o),e[0]=e[0].substring(0,i).trim(),e[3]=""}}var a=e[2],s="";if(this.options.pedantic){var u=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);u&&(a=u[1],s=u[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),/^</.test(a)&&(a=this.options.pedantic&&!/>$/.test(n)?a.slice(1):a.slice(1,-1)),g(e,{href:a?a.replace(this.rules.inline._escapes,"$1"):a,title:s?s.replace(this.rules.inline._escapes,"$1"):s},e[0],this.lexer)}},n.reflink=function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=e[r.toLowerCase()])||!r.href){var o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return g(n,r,n[0],this.lexer)}},n.emStrong=function(t,e,n){void 0===n&&(n="");var r=this.rules.inline.emStrong.lDelim.exec(t);if(r&&(!r[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var o=r[1]||r[2]||"";if(!o||o&&(""===n||this.rules.inline.punctuation.exec(n))){var i,a,s=r[0].length-1,u=s,c=0,l="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+s);null!=(r=l.exec(e));)if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(a=i.length,r[3]||r[4])u+=a;else if(!((r[5]||r[6])&&s%3)||(s+a)%3){if(!((u-=a)>0)){if(a=Math.min(a,a+u+c),Math.min(s,a)%2){var f=t.slice(1,s+r.index+a);return{type:"em",raw:t.slice(0,s+r.index+a+1),text:f,tokens:this.lexer.inlineTokens(f,[])}}var p=t.slice(2,s+r.index+a-1);return{type:"strong",raw:t.slice(0,s+r.index+a+1),text:p,tokens:this.lexer.inlineTokens(p,[])}}}else c+=a}}},n.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),r=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return r&&o&&(n=n.substring(1,n.length-1)),n=u(n,!0),{type:"codespan",raw:e[0],text:n}}},n.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},n.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2],[])}},n.autolink=function(t,e){var n,r,o=this.rules.inline.autolink.exec(t);if(o)return r="@"===o[2]?"mailto:"+(n=u(this.options.mangle?e(o[1]):o[1])):n=u(o[1]),{type:"link",raw:o[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},n.url=function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var r,o;if("@"===n[2])o="mailto:"+(r=u(this.options.mangle?e(n[0]):n[0]));else{var i;do{i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(i!==n[0]);r=u(n[0]),o="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}},n.inlineText=function(t,e){var n,r=this.rules.inline.text.exec(t);if(r)return n=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):u(r[0]):r[0]:u(this.options.smartypants?e(r[0]):r[0]),{type:"text",raw:r[0],text:n}},e}(),M={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:F,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};M.def=l(M.def).replace("label",M._label).replace("title",M._title).getRegex(),M.bullet=/(?:[*+-]|\d{1,9}[.)])/,M.listItemStart=l(/^( *)(bull) */).replace("bull",M.bullet).getRegex(),M.list=l(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex(),M._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",M._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,M.html=l(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M.paragraph=l(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.blockquote=l(M.blockquote).replace("paragraph",M.paragraph).getRegex(),M.normal=p({},M),M.gfm=p({},M.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),M.gfm.table=l(M.gfm.table).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.gfm.paragraph=l(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",M.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.pedantic=p({},M.normal,{html:l("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:F,paragraph:l(M.normal._paragraph).replace("hr",M.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var R={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:F,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:F,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};R.punctuation=l(R.punctuation).replace(/punctuation/g,R._punctuation).getRegex(),R.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,R.escapedEmSt=/\\\*|\\_/g,R._comment=l(M._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),R.emStrong.lDelim=l(R.emStrong.lDelim).replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimAst=l(R.emStrong.rDelimAst,"g").replace(/punct/g,R._punctuation).getRegex(),R.emStrong.rDelimUnd=l(R.emStrong.rDelimUnd,"g").replace(/punct/g,R._punctuation).getRegex(),R._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,R._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,R._email=/[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])?)+(?![-_])/,R.autolink=l(R.autolink).replace("scheme",R._scheme).replace("email",R._email).getRegex(),R._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,R.tag=l(R.tag).replace("comment",R._comment).replace("attribute",R._attribute).getRegex(),R._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,R._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,R._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,R.link=l(R.link).replace("label",R._label).replace("href",R._href).replace("title",R._title).getRegex(),R.reflink=l(R.reflink).replace("label",R._label).replace("ref",M._label).getRegex(),R.nolink=l(R.nolink).replace("ref",M._label).getRegex(),R.reflinkSearch=l(R.reflinkSearch,"g").replace("reflink",R.reflink).replace("nolink",R.nolink).getRegex(),R.normal=p({},R),R.pedantic=p({},R.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:l(/^!?\[(label)\]\((.*?)\)/).replace("label",R._label).getRegex(),reflink:l(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",R._label).getRegex()}),R.gfm=p({},R.normal,{escape:l(R.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),R.gfm.url=l(R.gfm.url,"i").replace("email",R.gfm._extended_email).getRegex(),R.breaks=p({},R.gfm,{br:l(R.br).replace("{2,}","*").getRegex(),text:l(R.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var L=function(){function e(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t.defaults,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={block:M.normal,inline:R.normal};this.options.pedantic?(n.block=M.pedantic,n.inline=R.pedantic):this.options.gfm&&(n.block=M.gfm,this.options.breaks?n.inline=R.breaks:n.inline=R.gfm),this.tokenizer.rules=n}e.lex=function(t,n){return new e(n).lex(t)},e.lexInline=function(t,n){return new e(n).inlineTokens(t)};var r=e.prototype;return r.lex=function(t){t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens);for(var e;e=this.inlineQueue.shift();)this.inlineTokens(e.src,e.tokens);return this.tokens},r.blockTokens=function(t,e){var n,r,o,i,a=this;for(void 0===e&&(e=[]),this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(r){return!!(n=r.call({lexer:a},t,e))&&(t=t.substring(n.raw.length),e.push(n),!0)}))))if(n=this.tokenizer.space(t))t=t.substring(n.raw.length),1===n.raw.length&&e.length>0?e[e.length-1].raw+="\n":e.push(n);else if(n=this.tokenizer.code(t))t=t.substring(n.raw.length),!(r=e[e.length-1])||"paragraph"!==r.type&&"text"!==r.type?e.push(n):(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.fences(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.heading(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.hr(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.blockquote(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.list(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.html(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.def(t))t=t.substring(n.raw.length),!(r=e[e.length-1])||"paragraph"!==r.type&&"text"!==r.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(r.raw+="\n"+n.raw,r.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text);else if(n=this.tokenizer.table(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.lheading(t))t=t.substring(n.raw.length),e.push(n);else if(o=t,this.options.extensions&&this.options.extensions.startBlock&&function(){var e=1/0,n=t.slice(1),r=void 0;a.options.extensions.startBlock.forEach((function(t){"number"==typeof(r=t.call({lexer:this},n))&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(o=t.substring(0,e+1))}(),this.state.top&&(n=this.tokenizer.paragraph(o)))r=e[e.length-1],i&&"paragraph"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):e.push(n),i=o.length!==t.length,t=t.substring(n.raw.length);else if(n=this.tokenizer.text(t))t=t.substring(n.raw.length),(r=e[e.length-1])&&"text"===r.type?(r.raw+="\n"+n.raw,r.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):e.push(n);else if(t){var s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent)break;throw new Error(s)}return this.state.top=!0,e},r.inline=function(t,e){this.inlineQueue.push({src:t,tokens:e})},r.inlineTokens=function(t,e){var n=this;void 0===e&&(e=[]);var r,o,i,a,s,u,c=t;if(this.tokens.links){var l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(a=this.tokenizer.rules.inline.reflinkSearch.exec(c));)l.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(c=c.slice(0,a.index)+"["+m("a",a[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(a=this.tokenizer.rules.inline.blockSkip.exec(c));)c=c.slice(0,a.index)+"["+m("a",a[0].length-2)+"]"+c.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(a=this.tokenizer.rules.inline.escapedEmSt.exec(c));)c=c.slice(0,a.index)+"++"+c.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(s||(u=""),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(o){return!!(r=o.call({lexer:n},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0)}))))if(r=this.tokenizer.escape(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.tag(t))t=t.substring(r.raw.length),(o=e[e.length-1])&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):e.push(r);else if(r=this.tokenizer.link(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(r.raw.length),(o=e[e.length-1])&&"text"===r.type&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):e.push(r);else if(r=this.tokenizer.emStrong(t,c,u))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.codespan(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.br(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.del(t))t=t.substring(r.raw.length),e.push(r);else if(r=this.tokenizer.autolink(t,b))t=t.substring(r.raw.length),e.push(r);else if(this.state.inLink||!(r=this.tokenizer.url(t,b))){if(i=t,this.options.extensions&&this.options.extensions.startInline&&function(){var e=1/0,r=t.slice(1),o=void 0;n.options.extensions.startInline.forEach((function(t){"number"==typeof(o=t.call({lexer:this},r))&&o>=0&&(e=Math.min(e,o))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}(),r=this.tokenizer.inlineText(i,y))t=t.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(u=r.raw.slice(-1)),s=!0,(o=e[e.length-1])&&"text"===o.type?(o.raw+=r.raw,o.text+=r.text):e.push(r);else if(t){var f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent)break;throw new Error(f)}}else t=t.substring(r.raw.length),e.push(r);return e},n(e,null,[{key:"rules",get:function(){return{block:M,inline:R}}}]),e}(),z=function(){function e(e){this.options=e||t.defaults}var n=e.prototype;return n.code=function(t,e,n){var r=(e||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(t,r);null!=o&&o!==t&&(n=!0,t=o)}return t=t.replace(/\n$/,"")+"\n",r?'<pre><code class="'+this.options.langPrefix+u(r,!0)+'">'+(n?t:u(t,!0))+"</code></pre>\n":"<pre><code>"+(n?t:u(t,!0))+"</code></pre>\n"},n.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},n.html=function(t){return t},n.heading=function(t,e,n,r){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+r.slug(n)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},n.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.list=function(t,e,n){var r=e?"ol":"ul";return"<"+r+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"</"+r+">\n"},n.listitem=function(t){return"<li>"+t+"</li>\n"},n.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},n.paragraph=function(t){return"<p>"+t+"</p>\n"},n.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},n.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},n.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+">\n"},n.strong=function(t){return"<strong>"+t+"</strong>"},n.em=function(t){return"<em>"+t+"</em>"},n.codespan=function(t){return"<code>"+t+"</code>"},n.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.del=function(t){return"<del>"+t+"</del>"},n.link=function(t,e,n){if(null===(t=f(this.options.sanitize,this.options.baseUrl,t)))return n;var r='<a href="'+u(t)+'"';return e&&(r+=' title="'+e+'"'),r+">"+n+"</a>"},n.image=function(t,e,n){if(null===(t=f(this.options.sanitize,this.options.baseUrl,t)))return n;var r='<img src="'+t+'" alt="'+n+'"';return e&&(r+=' title="'+e+'"'),r+(this.options.xhtml?"/>":">")},n.text=function(t){return t},e}(),N=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,n){return""+n},e.image=function(t,e,n){return""+n},e.br=function(){return""},t}(),U=function(){function t(){this.seen={}}var e=t.prototype;return e.serialize=function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},e.getNextSafeSlug=function(t,e){var n=t,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[t];do{n=t+"-"+ ++r}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=r,this.seen[n]=0),n},e.slug=function(t,e){void 0===e&&(e={});var n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)},t}(),V=function(){function e(e){this.options=e||t.defaults,this.options.renderer=this.options.renderer||new z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new N,this.slugger=new U}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var n=e.prototype;return n.parse=function(t,e){void 0===e&&(e=!0);var n,r,o,i,a,s,u,l,f,p,d,h,v,m,g,y,b,w,x,_="",E=t.length;for(n=0;n<E;n++)if(p=t[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type])||!1===(x=this.options.extensions.renderers[p.type].call({parser:this},p))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type))switch(p.type){case"space":continue;case"hr":_+=this.renderer.hr();continue;case"heading":_+=this.renderer.heading(this.parseInline(p.tokens),p.depth,c(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":_+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(l="",u="",i=p.header.length,r=0;r<i;r++)u+=this.renderer.tablecell(this.parseInline(p.header[r].tokens),{header:!0,align:p.align[r]});for(l+=this.renderer.tablerow(u),f="",i=p.rows.length,r=0;r<i;r++){for(u="",a=(s=p.rows[r]).length,o=0;o<a;o++)u+=this.renderer.tablecell(this.parseInline(s[o].tokens),{header:!1,align:p.align[o]});f+=this.renderer.tablerow(u)}_+=this.renderer.table(l,f);continue;case"blockquote":f=this.parse(p.tokens),_+=this.renderer.blockquote(f);continue;case"list":for(d=p.ordered,h=p.start,v=p.loose,i=p.items.length,f="",r=0;r<i;r++)y=(g=p.items[r]).checked,b=g.task,m="",g.task&&(w=this.renderer.checkbox(y),v?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=w+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=w+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:w}):m+=w),m+=this.parse(g.tokens,v),f+=this.renderer.listitem(m,b,y);_+=this.renderer.list(f,d,h);continue;case"html":_+=this.renderer.html(p.text);continue;case"paragraph":_+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(f=p.tokens?this.parseInline(p.tokens):p.text;n+1<E&&"text"===t[n+1].type;)f+="\n"+((p=t[++n]).tokens?this.parseInline(p.tokens):p.text);_+=e?this.renderer.paragraph(f):f;continue;default:var A='Token with "'+p.type+'" type was not found.';if(this.options.silent)return;throw new Error(A)}else _+=x||"";return _},n.parseInline=function(t,e){e=e||this.renderer;var n,r,o,i="",a=t.length;for(n=0;n<a;n++)if(r=t[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[r.type])||!1===(o=this.options.extensions.renderers[r.type].call({parser:this},r))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(r.type))switch(r.type){case"escape":i+=e.text(r.text);break;case"html":i+=e.html(r.text);break;case"link":i+=e.link(r.href,r.title,this.parseInline(r.tokens,e));break;case"image":i+=e.image(r.href,r.title,r.text);break;case"strong":i+=e.strong(this.parseInline(r.tokens,e));break;case"em":i+=e.em(this.parseInline(r.tokens,e));break;case"codespan":i+=e.codespan(r.text);break;case"br":i+=e.br();break;case"del":i+=e.del(this.parseInline(r.tokens,e));break;case"text":i+=e.text(r.text);break;default:var s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return;throw new Error(s)}else i+=o||"";return i},e}();w.options=w.setOptions=function(t){return p(w.defaults,t),s(w.defaults),w},w.getDefaults=a,w.defaults=t.defaults,w.use=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,o=p.apply(void 0,[{}].concat(e)),i=w.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((function(t){if(t.extensions&&(r=!0,t.extensions.forEach((function(t){if(!t.name)throw new Error("extension name required");if(t.renderer){var e=i.renderers?i.renderers[t.name]:null;i.renderers[t.name]=e?function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=t.renderer.apply(this,r);return!1===i&&(i=e.apply(this,r)),i}:t.renderer}if(t.tokenizer){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");i[t.level]?i[t.level].unshift(t.tokenizer):i[t.level]=[t.tokenizer],t.start&&("block"===t.level?i.startBlock?i.startBlock.push(t.start):i.startBlock=[t.start]:"inline"===t.level&&(i.startInline?i.startInline.push(t.start):i.startInline=[t.start]))}t.childTokens&&(i.childTokens[t.name]=t.childTokens)}))),t.renderer&&function(){var e=w.defaults.renderer||new z;for(var n in t.renderer)!function(n){var r=e[n];e[n]=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var s=t.renderer[n].apply(e,i);return!1===s&&(s=r.apply(e,i)),s}}(n);o.renderer=e}(),t.tokenizer&&function(){var e=w.defaults.tokenizer||new I;for(var n in t.tokenizer)!function(n){var r=e[n];e[n]=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var s=t.tokenizer[n].apply(e,i);return!1===s&&(s=r.apply(e,i)),s}}(n);o.tokenizer=e}(),t.walkTokens){var e=w.defaults.walkTokens;o.walkTokens=function(n){t.walkTokens.call(this,n),e&&e.call(this,n)}}r&&(o.extensions=i),w.setOptions(o)}))},w.walkTokens=function(t,e){for(var n,r=i(t);!(n=r()).done;)!function(){var t=n.value;switch(e.call(w,t),t.type){case"table":for(var r,o=i(t.header);!(r=o()).done;){var a=r.value;w.walkTokens(a.tokens,e)}for(var s,u=i(t.rows);!(s=u()).done;)for(var c,l=i(s.value);!(c=l()).done;){var f=c.value;w.walkTokens(f.tokens,e)}break;case"list":w.walkTokens(t.items,e);break;default:w.defaults.extensions&&w.defaults.extensions.childTokens&&w.defaults.extensions.childTokens[t.type]?w.defaults.extensions.childTokens[t.type].forEach((function(n){w.walkTokens(t[n],e)})):t.tokens&&w.walkTokens(t.tokens,e)}}()},w.parseInline=function(t,e){if(null==t)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");v(e=p({},w.defaults,e||{}));try{var n=L.lexInline(t,e);return e.walkTokens&&w.walkTokens(n,e.walkTokens),V.parseInline(n,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+u(t.message+"",!0)+"</pre>";throw t}},w.Parser=V,w.parser=V.parse,w.Renderer=z,w.TextRenderer=N,w.Lexer=L,w.lexer=L.lex,w.Tokenizer=I,w.Slugger=U,w.parse=w;var H=w.options,q=w.setOptions,W=w.use,J=w.walkTokens,G=w.parseInline,Q=w,Y=V.parse,K=L.lex;t.Lexer=L,t.Parser=V,t.Renderer=z,t.Slugger=U,t.TextRenderer=N,t.Tokenizer=I,t.getDefaults=a,t.lexer=K,t.marked=w,t.options=H,t.parse=Q,t.parseInline=G,t.parser=Y,t.setOptions=q,t.use=W,t.walkTokens=J,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,n){"use strict";function r(t,e){var n=function(t){var e={};return s(u(t),(function(t){var n=t[0],r=t[1];s(r,(function(t){e[t]=n}))})),e}(t.pluralTypeToLanguages);return n[e]||n[h.call(e,/-/,1)[0]]||n.en}function o(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i(t,e,n,r,o){if("string"!=typeof t)throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(null==e)return t;var i=t,a=r||b,s="number"==typeof e?{smart_count:e}:e;if(null!=s.smart_count&&t){var u=o||g,c=h.call(t,v),p=function(t,e,n){return t.pluralTypes[e](n)}(u,y(u,n||"en"),s.smart_count);i=f(c[p]||c[0])}return d.call(i,a,(function(t,e){return l(s,e)&&null!=s[e]?s[e]:t}))}function a(t){var e=t||{};this.phrases={},this.extend(e.phrases||{}),this.currentLocale=e.locale||"en";var n=e.allowMissing?i:null;this.onMissingKey="function"==typeof e.onMissingKey?e.onMissingKey:n,this.warn=e.warn||p,this.tokenRegex=function(t){var e=t&&t.prefix||"%{",n=t&&t.suffix||"}";if(e===v||n===v)throw new RangeError('"'+v+'" token is reserved for pluralization');return new RegExp(o(e)+"(.*?)"+o(n),"g")}(e.interpolation),this.pluralRules=e.pluralRules||g}var s=n(43),u=n(89),c=n(94),l=n(25),f=n(92),p=function(t){c(!1,t)},d=String.prototype.replace,h=String.prototype.split,v="||||",m=function(t){var e=t%100,n=e%10;return 11!==e&&1===n?0:2<=n&&n<=4&&!(e>=12&&e<=14)?1:2},g={pluralTypes:{arabic:function(t){if(t<3)return t;var e=t%100;return e>=3&&e<=10?3:e>=11?4:5},bosnian_serbian:m,chinese:function(){return 0},croatian:m,french:function(t){return t>=2?1:0},german:function(t){return 1!==t?1:0},russian:m,lithuanian:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=9&&(t%100<11||t%100>19)?1:2},czech:function(t){return 1===t?0:t>=2&&t<=4?1:2},polish:function(t){if(1===t)return 0;var e=t%10;return 2<=e&&e<=4&&(t%100<10||t%100>=20)?1:2},icelandic:function(t){return t%10!=1||t%100==11?1:0},slovenian:function(t){var e=t%100;return 1===e?0:2===e?1:3===e||4===e?2:3}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is"],slovenian:["sl-SL"]}},y=function(){var t={};return function(e,n){var o=t[n];return o&&!e.pluralTypes[o]&&(o=null,t[n]=o),o||(o=r(e,n))&&(t[n]=o),o}}(),b=/%\{(.*?)\}/g;a.prototype.locale=function(t){return t&&(this.currentLocale=t),this.currentLocale},a.prototype.extend=function(t,e){s(u(t||{}),(function(t){var n=t[0],r=t[1],o=e?e+"."+n:n;"object"==typeof r?this.extend(r,o):this.phrases[o]=r}),this)},a.prototype.unset=function(t,e){"string"==typeof t?delete this.phrases[t]:s(u(t||{}),(function(t){var n=t[0],r=t[1],o=e?e+"."+n:n;"object"==typeof r?this.unset(r,o):delete this.phrases[o]}),this)},a.prototype.clear=function(){this.phrases={}},a.prototype.replace=function(t){this.clear(),this.extend(t)},a.prototype.t=function(t,e){var n,r,o=null==e?{}:e;return"string"==typeof this.phrases[t]?n=this.phrases[t]:"string"==typeof o._?n=o._:this.onMissingKey?r=(0,this.onMissingKey)(t,o,this.currentLocale,this.tokenRegex,this.pluralRules):(this.warn('Missing translation for key: "'+t+'"'),r=t),"string"==typeof n&&(r=i(n,o,this.currentLocale,this.tokenRegex,this.pluralRules)),r},a.prototype.has=function(t){return l(this.phrases,t)},a.transformPhrase=function(t,e,n){return i(t,e,n)},t.exports=a},function(t,e,n){"use strict";function r(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)} +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,s,u=r(t),c=1;c<arguments.length;c++){for(var l in n=Object(arguments[c]))i.call(n,l)&&(u[l]=n[l]);if(o){s=o(n);for(var f=0;f<s.length;f++)a.call(n,s[f])&&(u[s[f]]=n[s[f]])}}return u}},function(t,e,n){function r(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||N.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var r=t<0?-q(-t):q(t);if(r!==t){var o=String(r),i=M.call(e,o.length+1);return R.call(o,n,"$&_")+"."+R.call(R.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return R.call(e,n,"$&_")}function o(t,e,n){var r="double"===(n.quoteStyle||e)?'"':"'";return r+t+r}function i(t){return R.call(String(t),/"/g,""")}function a(t){return!("[object Array]"!==c(t)||Y&&"object"==typeof t&&Y in t)}function s(t){if(Q)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!G)return!1;try{return G.call(t),!0}catch(t){}return!1}function u(t,e){return et.call(t,e)}function c(t){return B.call(t)}function l(t){if(t.name)return t.name;var e=I.call(F.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function f(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function p(t){if(!$||!t||"object"!=typeof t)return!1;try{$.call(t,$);try{j.call(t,j)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}function d(t){if(!T||!t||"object"!=typeof t)return!1;try{return T.call(t),!0}catch(t){}return!1}function h(t){if(!j||!t||"object"!=typeof t)return!1;try{j.call(t,j);try{$.call(t,$)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}function v(t,e){if(t.length>e.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return v(M.call(t,0,e.maxStringLength),e)+r}return o(R.call(R.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,m),"single",e)}function m(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+L.call(e.toString(16))}function g(t){return"Object("+t+")"}function y(t){return t+" { ? }"}function b(t,e,n,r){return t+" ("+e+") {"+(r?w(n,r):V.call(n,", "))+"}"}function w(t,e){if(0===t.length)return"";var n="\n"+e.prev+e.base;return n+V.call(t,","+n)+"\n"+e.prev}function x(t,e){var n=a(t),r=[];if(n){r.length=t.length;for(var o=0;o<t.length;o++)r[o]=u(t,o)?e(t[o],t):""}var i,s="function"==typeof J?J(t):[];if(Q){i={};for(var c=0;c<s.length;c++)i["$"+s[c]]=s[c]}for(var l in t)u(t,l)&&(n&&String(Number(l))===l&&l<t.length||Q&&i["$"+l]instanceof Symbol||(N.call(/[^\w$]/,l)?r.push(e(l,t)+": "+e(t[l],t)):r.push(l+": "+e(t[l],t))));if("function"==typeof J)for(var f=0;f<s.length;f++)K.call(t,s[f])&&r.push("["+e(s[f])+"]: "+e(t[s[f]],t));return r}var _="function"==typeof Map&&Map.prototype,E=Object.getOwnPropertyDescriptor&&_?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,A=_&&E&&"function"==typeof E.get?E.get:null,k=_&&Map.prototype.forEach,C="function"==typeof Set&&Set.prototype,D=Object.getOwnPropertyDescriptor&&C?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,O=C&&D&&"function"==typeof D.get?D.get:null,S=C&&Set.prototype.forEach,$="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,j="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,T="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,P=Boolean.prototype.valueOf,B=Object.prototype.toString,F=Function.prototype.toString,I=String.prototype.match,M=String.prototype.slice,R=String.prototype.replace,L=String.prototype.toUpperCase,z=String.prototype.toLowerCase,N=RegExp.prototype.test,U=Array.prototype.concat,V=Array.prototype.join,H=Array.prototype.slice,q=Math.floor,W="function"==typeof BigInt?BigInt.prototype.valueOf:null,J=Object.getOwnPropertySymbols,G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Q="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Y="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,K=Object.prototype.propertyIsEnumerable,Z=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null),X=n(102).custom,tt=X&&s(X)?X:null;t.exports=function t(e,n,m,_){function E(e,n,r){if(n&&(_=H.call(_)).push(n),r){var o={depth:C.depth};return u(C,"quoteStyle")&&(o.quoteStyle=C.quoteStyle),t(e,o,m+1,_)}return t(e,C,m+1,_)}var C=n||{};if(u(C,"quoteStyle")&&"single"!==C.quoteStyle&&"double"!==C.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(u(C,"maxStringLength")&&("number"==typeof C.maxStringLength?C.maxStringLength<0&&C.maxStringLength!==1/0:null!==C.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var D=!u(C,"customInspect")||C.customInspect;if("boolean"!=typeof D&&"symbol"!==D)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(u(C,"indent")&&null!==C.indent&&"\t"!==C.indent&&!(parseInt(C.indent,10)===C.indent&&C.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(u(C,"numericSeparator")&&"boolean"!=typeof C.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var $=C.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return v(e,C);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var j=String(e);return $?r(e,j):j}if("bigint"==typeof e){var T=String(e)+"n";return $?r(e,T):T}var B=void 0===C.depth?5:C.depth;if(void 0===m&&(m=0),m>=B&&B>0&&"object"==typeof e)return a(e)?"[Array]":"[Object]";var F=function(t,e){var n;if("\t"===t.indent)n="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;n=V.call(Array(t.indent+1)," ")}return{base:n,prev:V.call(Array(e+1),n)}}(C,m);if(void 0===_)_=[];else if(f(_,e)>=0)return"[Circular]";if("function"==typeof e){var I=l(e),L=x(e,E);return"[Function"+(I?": "+I:" (anonymous)")+"]"+(L.length>0?" { "+V.call(L,", ")+" }":"")}if(s(e)){var N=Q?R.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):G.call(e);return"object"!=typeof e||Q?N:g(N)}if(function(t){return!(!t||"object"!=typeof t)&&("undefined"!=typeof HTMLElement&&t instanceof HTMLElement||"string"==typeof t.nodeName&&"function"==typeof t.getAttribute)}(e)){for(var q="<"+z.call(String(e.nodeName)),J=e.attributes||[],X=0;X<J.length;X++)q+=" "+J[X].name+"="+o(i(J[X].value),"double",C);return q+=">",e.childNodes&&e.childNodes.length&&(q+="..."),q+"</"+z.call(String(e.nodeName))+">"}if(a(e)){if(0===e.length)return"[]";var et=x(e,E);return F&&!function(t){for(var e=0;e<t.length;e++)if(f(t[e],"\n")>=0)return!1;return!0}(et)?"["+w(et,F)+"]":"[ "+V.call(et,", ")+" ]"}if(function(t){return!("[object Error]"!==c(t)||Y&&"object"==typeof t&&Y in t)}(e)){var nt=x(e,E);return"cause"in e&&!K.call(e,"cause")?"{ ["+String(e)+"] "+V.call(U.call("[cause]: "+E(e.cause),nt),", ")+" }":0===nt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+V.call(nt,", ")+" }"}if("object"==typeof e&&D){if(tt&&"function"==typeof e[tt])return e[tt]();if("symbol"!==D&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!A||!t||"object"!=typeof t)return!1;try{A.call(t);try{O.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var rt=[];return k.call(e,(function(t,n){rt.push(E(n,e,!0)+" => "+E(t,e))})),b("Map",A.call(e),rt,F)}if(function(t){if(!O||!t||"object"!=typeof t)return!1;try{O.call(t);try{A.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ot=[];return S.call(e,(function(t){ot.push(E(t,e))})),b("Set",O.call(e),ot,F)}if(p(e))return y("WeakMap");if(h(e))return y("WeakSet");if(d(e))return y("WeakRef");if(function(t){return!("[object Number]"!==c(t)||Y&&"object"==typeof t&&Y in t)}(e))return g(E(Number(e)));if(function(t){if(!t||"object"!=typeof t||!W)return!1;try{return W.call(t),!0}catch(t){}return!1}(e))return g(E(W.call(e)));if(function(t){return!("[object Boolean]"!==c(t)||Y&&"object"==typeof t&&Y in t)}(e))return g(P.call(e));if(function(t){return!("[object String]"!==c(t)||Y&&"object"==typeof t&&Y in t)}(e))return g(E(String(e)));if(!function(t){return!("[object Date]"!==c(t)||Y&&"object"==typeof t&&Y in t)}(e)&&!function(t){return!("[object RegExp]"!==c(t)||Y&&"object"==typeof t&&Y in t)}(e)){var it=x(e,E),at=Z?Z(e)===Object.prototype:e instanceof Object||e.constructor===Object,st=e instanceof Object?"":"null prototype",ut=!at&&Y&&Object(e)===e&&Y in e?M.call(c(e),8,-1):st?"Object":"",ct=(at||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ut||st?"["+V.call(U.call([],ut||[],st||[]),": ")+"] ":"");return 0===it.length?ct+"{}":F?ct+"{"+w(it,F)+"}":ct+"{ "+V.call(it,", ")+" }"}return String(e)};var et=Object.prototype.hasOwnProperty||function(t){return t in this}},function(t,e,n){"use strict";var r;if(!Object.keys){var o=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=n(26),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),h=function(t){if("undefined"==typeof window||!d)return f(t);try{return f(t)}catch(t){return!1}};r=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===i.call(t),r=a(t),s=e&&"[object String]"===i.call(t),f=[];if(!e&&!n&&!r)throw new TypeError("Object.keys called on a non-object");var p=c&&n;if(s&&t.length>0&&!o.call(t,0))for(var d=0;d<t.length;++d)f.push(String(d));if(r&&t.length>0)for(var v=0;v<t.length;++v)f.push(String(v));else for(var m in t)p&&"prototype"===m||!o.call(t,m)||f.push(String(m));if(u)for(var g=h(t),y=0;y<l.length;++y)g&&"constructor"===l[y]||!o.call(t,l[y])||f.push(l[y]);return f}}t.exports=r},function(t,e,n){"use strict";var r=Array.prototype.slice,o=n(26),i=Object.keys,a=i?function(t){return i(t)}:n(87),s=Object.keys;a.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return s(o(t)?r.call(t):t)}):Object.keys=a,Object.keys||a},t.exports=a},function(t,e,n){"use strict";var r=n(2),o=n(4),i=n(27),a=n(28),s=n(90),u=o(a(),Object);r(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},function(t,e,n){"use strict";var r=n(28),o=n(2);t.exports=function(){var t=r();return o(Object,{entries:t},{entries:function(){return Object.entries!==t}}),t}},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(c===setTimeout)return setTimeout(t,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(t,0);try{return c(t,0)}catch(e){try{return c.call(null,t,0)}catch(e){return c.call(this,t,0)}}}function i(){h&&p&&(h=!1,p.length?d=p.concat(d):v=-1,d.length&&a())}function a(){if(!h){var t=o(i);h=!0;for(var e=d.length;e;){for(p=d,d=[];++v<e;)p&&p[v].run();v=-1,e=d.length}p=null,h=!1,function(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}(t)}}function s(t,e){this.fun=t,this.array=e}function u(){}var c,l,f=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:n}catch(t){c=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var p,d=[],h=!1,v=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new s(t,e)),1!==d.length||h||o(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){"use strict";var r=n(4),o=n(2),i=n(29),a=n(30),s=n(93),u=r(a());o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},function(t,e,n){"use strict";var r=n(2),o=n(30);t.exports=function(){var t=o();return r(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},function(t,e,n){"use strict";(function(e){var n=function(){};if("production"!==e.env.NODE_ENV){var r=function(t,e){var n=arguments.length;e=new Array(n>1?n-1:0);for(var r=1;r<n;r++)e[r-1]=arguments[r];var o=0,i="Warning: "+t.replace(/%s/g,(function(){return e[o++]}));try{throw new Error(i)}catch(t){}};n=function(t,e,n){var o=arguments.length;n=new Array(o>2?o-2:0);for(var i=2;i<o;i++)n[i-2]=arguments[i];if(void 0===e)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");t||r.apply(null,[e].concat(n))}}t.exports=n}).call(e,n(91))},function(t,e,n){function r(t,e){return new a(e).process(t)}var o=n(31),i=n(32),a=n(96);for(var s in(e=t.exports=r).filterXSS=r,e.FilterXSS=a,o)e[s]=o[s];for(var s in i)e[s]=i[s];"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)},function(t,e,n){function r(t){return null==t}function o(t){(t=function(t){var e={};for(var n in t)e[n]=t[n];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag,t.onIgnoreTag=a.onIgnoreTagStripAll),t.whiteList=t.whiteList||t.allowList||a.whiteList,t.onTag=t.onTag||a.onTag,t.onTagAttr=t.onTagAttr||a.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||a.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||a.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||a.safeAttrValue,t.escapeHtml=t.escapeHtml||a.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new i(t.css))}var i=n(7).FilterCSS,a=n(31),s=n(32),u=s.parseTag,c=s.parseAttr,l=n(11);o.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,n=e.whiteList,o=e.onTag,i=e.onIgnoreTag,s=e.onTagAttr,f=e.onIgnoreTagAttr,p=e.safeAttrValue,d=e.escapeHtml,h=this.cssFilter;e.stripBlankChar&&(t=a.stripBlankChar(t)),e.allowCommentTag||(t=a.stripCommentTag(t));var v=!1;e.stripIgnoreTagBody&&(v=a.StripTagBody(e.stripIgnoreTagBody,i),i=v.onIgnoreTag);var m=u(t,(function(t,e,a,u,v){var m,g={sourcePosition:t,position:e,isClosing:v,isWhite:n.hasOwnProperty(a)};if(!r(m=o(a,u,g)))return m;if(g.isWhite){if(g.isClosing)return"</"+a+">";var y=function(t){var e=l.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var n="/"===(t=l.trim(t.slice(e+1,-1)))[t.length-1];return n&&(t=l.trim(t.slice(0,-1))),{html:t,closing:n}}(u),b=n[a],w=c(y.html,(function(t,e){var n,o=-1!==l.indexOf(b,t);return r(n=s(a,t,e,o))?o?(e=p(a,t,e,h))?t+'="'+e+'"':t:r(n=f(a,t,e,o))?void 0:n:n}));return u="<"+a,w&&(u+=" "+w),y.closing&&(u+=" /"),u+">"}return r(m=i(a,u,g))?d(u):m}),d);return v&&(m=v.remove(m)),m},t.exports=o},function(t,e){t.exports={smile:"e3/2018new_weixioa02_org.png",lovely:"09/2018new_keai_org.png",happy:"1e/2018new_taikaixin_org.png",clap:"6e/2018new_guzhang_thumb.png",whee:"33/2018new_xixi_thumb.png",haha:"8f/2018new_haha_thumb.png","laugh and cry":"4a/2018new_xiaoku_thumb.png",wink:"43/2018new_jiyan_org.png",greddy:"fa/2018new_chanzui_org.png",awkward:"a3/2018new_heixian_thumb.png",sweat:"28/2018new_han_org.png","pick nose":"9a/2018new_wabi_thumb.png",hum:"7c/2018new_heng_thumb.png",angry:"f6/2018new_nu_thumb.png",grievance:"a5/2018new_weiqu_thumb.png",poor:"96/2018new_kelian_org.png",disappoint:"aa/2018new_shiwang_thumb.png",sad:"ee/2018new_beishang_org.png",tear:"6e/2018new_leimu_org.png","no way":"83/2018new_kuxiao_org.png",shy:"c1/2018new_haixiu_org.png",dirt:"10/2018new_wu_thumb.png","love you":"f6/2018new_aini_org.png",kiss:"2c/2018new_qinqin_thumb.png",amorousness:"9d/2018new_huaxin_org.png",longing:"c9/2018new_chongjing_org.png",desire:"3e/2018new_tianping_thumb.png","bad laugh":"4d/2018new_huaixiao_org.png",blackness:"9e/2018new_yinxian_org.png","laugh without word":"2d/2018new_xiaoerbuyu_org.png",titter:"71/2018new_touxiao_org.png",cool:"c4/2018new_ku_org.png","not easy":"aa/2018new_bingbujiandan_thumb.png",think:"30/2018new_sikao_org.png",question:"b8/2018new_ningwen_org.png","no idea":"2a/2018new_wenhao_thumb.png",dizzy:"07/2018new_yun_thumb.png",bomb:"a2/2018new_shuai_thumb.png",bone:"a1/2018new_kulou_thumb.png","be quiet":"b0/2018new_xu_org.png","shut up":"62/2018new_bizui_org.png",stupid:"dd/2018new_shayan_org.png","surprise ":"49/2018new_chijing_org.png",vomit:"08/2018new_tu_org.png",cold:"40/2018new_kouzhao_thumb.png",sick:"3b/2018new_shengbing_thumb.png",bye:"fd/2018new_baibai_thumb.png","look down on":"da/2018new_bishi_org.png","white eye":"ef/2018new_landelini_org.png","left hum":"43/2018new_zuohengheng_thumb.png","right hum":"c1/2018new_youhengheng_thumb.png",crazy:"17/2018new_zhuakuang_org.png","scold ":"87/2018new_zhouma_thumb.png","hit on face":"cb/2018new_dalian_org.png",wow:"ae/2018new_ding_org.png",fan:"86/2018new_hufen02_org.png",money:"a2/2018new_qian_thumb.png",yawn:"55/2018new_dahaqian_org.png",sleepy:"3c/2018new_kun_thumb.png",sleep:"e2/2018new_shuijiao_thumb.png","watermelon ":"01/2018new_chigua_thumb.png",doge:"a1/2018new_doge02_org.png",dog:"22/2018new_erha_org.png",cat:"7b/2018new_miaomiao_thumb.png",thumb:"e6/2018new_zan_org.png",good:"8a/2018new_good_org.png",ok:"45/2018new_ok_org.png",yeah:"29/2018new_ye_thumb.png","shack hand":"e9/2018new_woshou_thumb.png",bow:"e7/2018new_zuoyi_org.png",come:"42/2018new_guolai_thumb.png",punch:"86/2018new_quantou_thumb.png"}},function(t,e){t.exports={nick:"NickName",mail:"E-Mail",link:"Website(http://)",nickFail:"NickName cannot be less than 3 bytes.",mailFail:"Please confirm your email address.",sofa:"No comment yet.",submit:"Submit",reply:"Reply",cancelReply:"Cancel reply",comments:"Comments",cancel:"Cancel",confirm:"Confirm",continue:"Continue",more:"Load More...",preview:"Preview",emoji:"Emoji",expand:"See more....",seconds:"seconds ago",minutes:"minutes ago",hours:"hours ago",days:"days ago",now:"just now",uploading:"Uploading ...",uploadDone:"Upload completed!",busy:"Submit is busy, please wait...","code-98":"Valine initialization failed, please check your version of av-min.js.","code-99":"Valine initialization failed, Please check the `el` element in the init method.","code-100":"Valine initialization failed, Please check your appId and appKey.","code-140":"The total number of API calls today has exceeded the development version limit.","code-401":"Unauthorized operation, Please check your appId and appKey.","code-403":"Access denied by API domain white list, Please check your security domain."}},function(t,e){t.exports={nick:"ニックネーム",mail:"メールアドレス",link:"サイト(http://)",nickFail:"3バイト以上のニックネームをご入力ください.",mailFail:"メールアドレスをご確認ください.",sofa:"コメントしましょう~",submit:"提出する",reply:"返信する",cancelReply:"キャンセル",comments:"コメント",cancel:"キャンセル",confirm:"確認する",continue:"继续",more:"さらに読み込む...",preview:"プレビュー",emoji:"絵文字",expand:"もっと見る",seconds:"秒前",minutes:"分前",hours:"時間前",days:"日前",now:"たっだ今",uploading:"アップロード中...",uploadDone:"アップロードが完了しました!",busy:"20 秒間隔で提出してください ...","code-98":"ロードエラーです。av-min.js のバージョンを確認してください.","code-99":"ロードエラーです。initにある`el`エレメントを確認ください.","code-100":"ロードエラーです。AppIdとAppKeyを確認ください.","code-140":"今日のAPIコールの総数が開発バージョンの上限を超えた.","code-401":"権限が制限されています。AppIdとAppKeyを確認ください.","code-403":"アクセスがAPIなどに制限されました、ドメイン名のセキュリティ設定を確認ください"}},function(t,e){t.exports={nick:"昵称",mail:"邮箱",link:"网址(http://)",nickFail:"昵称不能少于3个字符",mailFail:"请填写正确的邮件地址",sofa:"来发评论吧~",submit:"提交",reply:"回复",cancelReply:"取消回复",comments:"评论",cancel:"取消",confirm:"确认",continue:"继续",more:"加载更多...",preview:"预览",emoji:"表情",expand:"查看更多...",seconds:"秒前",minutes:"分钟前",hours:"小时前",days:"天前",now:"刚刚",uploading:"正在传输...",uploadDone:"传输完成!",busy:"操作频繁,请稍候再试...","code-98":"Valine 初始化失败,请检查 av-min.js 版本","code-99":"Valine 初始化失败,请检查init中的`el`元素.","code-100":"Valine 初始化失败,请检查你的AppId和AppKey.","code-140":"今日 API 调用总次数已超过开发版限制.","code-401":"未经授权的操作,请检查你的AppId和AppKey.","code-403":"访问被API域名白名单拒绝,请检查你的安全域名设置."}},function(t,e){t.exports={nick:"暱稱",mail:"郵箱",link:"網址(http://)",nickFail:"昵稱不能少於3個字符",mailFail:"請填寫正確的郵件地址",sofa:"來發評論吧~",submit:"提交",reply:"回覆",cancelReply:"取消回覆",comments:"評論",cancel:"取消",confirm:"確認",continue:"繼續",more:"加載更多...",preview:"預覽",emoji:"表情",expand:"查看更多...",seconds:"秒前",minutes:"分鐘前",hours:"小時前",days:"天前",now:"剛剛",uploading:"正在上傳...",uploadDone:"上傳完成!",busy:"操作頻繁,請稍候再試...","code-98":"Valine 初始化失敗,請檢查 av-min.js 版本","code-99":"Valine 初始化失敗,請檢查init中的`el`元素.","code-100":"Valine 初始化失敗,請檢查你的AppId和AppKey.","code-140":"今日 API 調用總次數已超過開發版限制.","code-401":"未經授權的操作,請檢查你的AppId和AppKey.","code-403":"訪問被API域名白名單拒絕,請檢查你的安全域名設置."}},function(t,e){},function(t,e,n){var r=n(104);"string"==typeof r&&(r=[[t.i,r,""]]);var o={transform:void 0};n(106)(r,o),r.locals&&(t.exports=r.locals)},function(t,e,n){(e=n(105)(!1)).push([t.i,'.v[data-class=v]{font-size:16px;text-align:left}.v[data-class=v] *{-webkit-box-sizing:border-box;box-sizing:border-box;line-height:1.75}.v[data-class=v] .vinput,.v[data-class=v] .veditor,.v[data-class=v] p,.v[data-class=v] pre code,.v[data-class=v] .status-bar{color:#555}.v[data-class=v] .vtime,.v[data-class=v] .vsys{color:#b3b3b3}.v[data-class=v] .text-right{text-align:right}.v[data-class=v] .text-center{text-align:center}.v[data-class=v] img{max-width:100%;border:none}.v[data-class=v] hr{margin:.825em 0;border-color:#f6f6f6;border-style:dashed}.v[data-class=v].hide-avatar .vimg{display:none}.v[data-class=v] a{position:relative;cursor:pointer;color:#1abc9c;text-decoration:none;display:inline-block}.v[data-class=v] a:hover{color:#d7191a}.v[data-class=v] pre,.v[data-class=v] code{background-color:#f8f8f8;padding:.2em .4em;border-radius:3px;font-size:85%;margin:0}.v[data-class=v] pre{padding:10px;overflow:auto;line-height:1.45}.v[data-class=v] pre code{padding:0;background:transparent;white-space:pre-wrap;word-break:keep-all}.v[data-class=v] blockquote{color:#666;margin:.5em 0;padding:0 0 0 1em;border-left:8px solid rgba(238,238,238,.5)}.v[data-class=v] .vinput{border:none;resize:none;outline:none;padding:10px 5px;max-width:100%;font-size:.775em;-webkit-box-sizing:border-box;box-sizing:border-box}.v[data-class=v] input[type=checkbox],.v[data-class=v] input[type=radio]{display:inline-block;vertical-align:middle;margin-top:-2px}.v[data-class=v] .vicon{cursor:pointer;display:inline-block;overflow:hidden;fill:#555;vertical-align:middle}.v[data-class=v] .vicon+.vicon{margin-left:10px}.v[data-class=v] .vicon.actived{fill:#66b1ff}.v[data-class=v] .vrow{font-size:0;padding:10px 0}.v[data-class=v] .vrow .vcol{display:inline-block;vertical-align:middle;font-size:14px}.v[data-class=v] .vrow .vcol.vcol-20{width:20%}.v[data-class=v] .vrow .vcol.vcol-30{width:30%}.v[data-class=v] .vrow .vcol.vcol-40{width:40%}.v[data-class=v] .vrow .vcol.vcol-50{width:50%}.v[data-class=v] .vrow .vcol.vcol-60{width:60%}.v[data-class=v] .vrow .vcol.vcol-70{width:70%}.v[data-class=v] .vrow .vcol.vcol-80{width:80%}.v[data-class=v] .vrow .vcol.vctrl{font-size:12px}.v[data-class=v] .vemoji,.v[data-class=v] .emoji{width:26px;height:26px;overflow:hidden;vertical-align:middle;margin:0 1px;display:inline-block}.v[data-class=v] .vwrap{border:1px solid #f0f0f0;border-radius:4px;margin-bottom:10px;overflow:hidden;position:relative;padding:10px}.v[data-class=v] .vwrap input{background:transparent}.v[data-class=v] .vwrap .vedit{position:relative;padding-top:10px}.v[data-class=v] .vwrap .cancel-reply-btn{position:absolute;right:5px;top:5px;cursor:pointer}.v[data-class=v] .vwrap .vemojis{display:none;font-size:18px;max-height:145px;overflow:auto;padding-bottom:10px;-webkit-box-shadow:0px 0 1px #f0f0f0;box-shadow:0px 0 1px #f0f0f0}.v[data-class=v] .vwrap .vemojis i{font-style:normal;padding-top:7px;width:36px;cursor:pointer;text-align:center;display:inline-block;vertical-align:middle}.v[data-class=v] .vwrap .vpreview{padding:7px;-webkit-box-shadow:0px 0 1px #f0f0f0;box-shadow:0px 0 1px #f0f0f0}.v[data-class=v] .vwrap .vheader .vinput{width:33.33%;border-bottom:1px #dedede dashed}.v[data-class=v] .vwrap .vheader.item2 .vinput{width:50%}.v[data-class=v] .vwrap .vheader.item1 .vinput{width:100%}.v[data-class=v] .vwrap .vheader .vinput:focus{border-bottom-color:#eb5055}@media screen and (max-width: 520px){.v[data-class=v] .vwrap .vheader .vinput{width:100%}.v[data-class=v] .vwrap .vheader.item2 .vinput{width:100%}}.v[data-class=v] .vpower{color:#999;font-size:.75em;padding:.5em 0}.v[data-class=v] .vpower a{font-size:.75em}.v[data-class=v] .vcount{padding:5px;font-weight:600;font-size:1.25em}.v[data-class=v] ul,.v[data-class=v] ol{padding:0;margin-left:1.25em}.v[data-class=v] .txt-center{text-align:center}.v[data-class=v] .txt-right{text-align:right}.v[data-class=v] .veditor{width:100%;min-height:8.75em;font-size:.875em;background:transparent;resize:vertical;-webkit-transition:all .25s ease;transition:all .25s ease}.v[data-class=v] .vbtn{-webkit-transition-duration:.4s;transition-duration:.4s;text-align:center;color:#555;border:1px solid #ededed;border-radius:.3em;display:inline-block;background:transparent;margin-bottom:0;font-weight:400;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;white-space:nowrap;padding:.5em 1.25em;font-size:.875em;line-height:1.42857143;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none}.v[data-class=v] .vbtn+.vbtn{margin-left:1.25em}.v[data-class=v] .vbtn:active,.v[data-class=v] .vbtn:hover{color:#3090e4;border-color:#3090e4}.v[data-class=v] .vbtn:disabled{border-color:#e1e1e1;color:#e1e1e1;background-color:#fdfafa;cursor:not-allowed}.v[data-class=v] .vempty{padding:1.25em;text-align:center;color:#555;overflow:auto}.v[data-class=v] .vsys{display:inline-block;padding:.2em .5em;font-size:.75em;border-radius:.2em;margin-right:.3em}@media screen and (max-width: 520px){.v[data-class=v] .vsys{display:none}}.v[data-class=v] .vcards{width:100%}.v[data-class=v] .vcards .vcard{padding-top:1.25em;position:relative;display:block}.v[data-class=v] .vcards .vcard:after{content:"";clear:both;display:block}.v[data-class=v] .vcards .vcard .vimg{width:3.125em;height:3.125em;float:left;border-radius:50%;margin-right:.7525em;border:1px solid #f5f5f5;padding:.125em}@media screen and (max-width: 720px){.v[data-class=v] .vcards .vcard .vimg{width:2.5em;height:2.5em}}.v[data-class=v] .vcards .vcard .vhead{line-height:1.5;margin-top:0}.v[data-class=v] .vcards .vcard .vhead .vnick{position:relative;font-size:.875em;font-weight:500;margin-right:.875em;cursor:pointer;text-decoration:none;display:inline-block}.v[data-class=v] .vcards .vcard .vhead .vnick:hover{color:#d7191a}.v[data-class=v] .vcards .vcard .vh{overflow:hidden;padding-bottom:.5em;border-bottom:1px dashed #f5f5f5}.v[data-class=v] .vcards .vcard .vh .vtime{font-size:.75em;margin-right:.875em}.v[data-class=v] .vcards .vcard .vh .vmeta{line-height:1;position:relative}.v[data-class=v] .vcards .vcard .vh .vmeta .vat{font-size:.8125em;color:#ef2f11;cursor:pointer;float:right}.v[data-class=v] .vcards .vcard:last-child .vh{border-bottom:none}.v[data-class=v] .vcards .vcard .vcontent{word-wrap:break-word;word-break:break-all;font-size:.875em;line-height:2;position:relative;margin-bottom:.75em;padding-top:.625em}.v[data-class=v] .vcards .vcard .vcontent.expand{cursor:pointer;max-height:8em;overflow:hidden}.v[data-class=v] .vcards .vcard .vcontent.expand::before{display:block;content:"";position:absolute;width:100%;left:0;top:0;bottom:3.15em;background:-webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.9)));background:linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));z-index:999}.v[data-class=v] .vcards .vcard .vcontent.expand::after{display:block;content:attr(data-expand);text-align:center;color:#828586;position:absolute;width:100%;height:3.15em;line-height:3.15em;left:0;bottom:0;z-index:999;background:rgba(255,255,255,.9)}.v[data-class=v] .vcards .vcard .vquote{padding-left:1em;border-left:1px dashed rgba(238,238,238,.5)}.v[data-class=v] .vcards .vcard .vquote .vimg{width:2.225em;height:2.225em}.v[data-class=v] .vpage .vmore{margin:1em 0}.v[data-class=v] .clear{content:"";display:block;clear:both}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes pulse{50%{background:#dcdcdc}}@keyframes pulse{50%{background:#dcdcdc}}.v[data-class=v] .vspinner{width:22px;height:22px;display:inline-block;border:6px double #a0a0a0;border-top-color:transparent;border-bottom-color:transparent;border-radius:50%;-webkit-animation:spin 1s infinite linear;animation:spin 1s infinite linear;position:relative;vertical-align:middle;margin:0 5px}[data-theme=dark] .v[data-class=v] .vinput,[data-theme=dark] .v[data-class=v] .veditor,[data-theme=dark] .v[data-class=v] p,[data-theme=dark] .v[data-class=v] pre code,[data-theme=dark] .v[data-class=v] .status-bar,.dark .v[data-class=v] .vinput,.dark .v[data-class=v] .veditor,.dark .v[data-class=v] p,.dark .v[data-class=v] pre code,.dark .v[data-class=v] .status-bar,.theme__dark .v[data-class=v] .vinput,.theme__dark .v[data-class=v] .veditor,.theme__dark .v[data-class=v] p,.theme__dark .v[data-class=v] pre code,.theme__dark .v[data-class=v] .status-bar,.night .v[data-class=v] .vinput,.night .v[data-class=v] .veditor,.night .v[data-class=v] p,.night .v[data-class=v] pre code,.night .v[data-class=v] .status-bar{color:#b2b2b5}[data-theme=dark] .v[data-class=v] .vtime,[data-theme=dark] .v[data-class=v] .vsys,.dark .v[data-class=v] .vtime,.dark .v[data-class=v] .vsys,.theme__dark .v[data-class=v] .vtime,.theme__dark .v[data-class=v] .vsys,.night .v[data-class=v] .vtime,.night .v[data-class=v] .vsys{color:#929298}[data-theme=dark] .v[data-class=v] pre,[data-theme=dark] .v[data-class=v] code,[data-theme=dark] .v[data-class=v] pre code,.dark .v[data-class=v] pre,.dark .v[data-class=v] code,.dark .v[data-class=v] pre code,.theme__dark .v[data-class=v] pre,.theme__dark .v[data-class=v] code,.theme__dark .v[data-class=v] pre code,.night .v[data-class=v] pre,.night .v[data-class=v] code,.night .v[data-class=v] pre code{color:#929298;background-color:#151414}[data-theme=dark] .v[data-class=v] .vwrap,.dark .v[data-class=v] .vwrap,.theme__dark .v[data-class=v] .vwrap,.night .v[data-class=v] .vwrap{border-color:#b2b2b5}[data-theme=dark] .v[data-class=v] .vicon,.dark .v[data-class=v] .vicon,.theme__dark .v[data-class=v] .vicon,.night .v[data-class=v] .vicon{fill:#b2b2b5}[data-theme=dark] .v[data-class=v] .vicon.actived,.dark .v[data-class=v] .vicon.actived,.theme__dark .v[data-class=v] .vicon.actived,.night .v[data-class=v] .vicon.actived{fill:#66b1ff}[data-theme=dark] .v[data-class=v] .vbtn,.dark .v[data-class=v] .vbtn,.theme__dark .v[data-class=v] .vbtn,.night .v[data-class=v] .vbtn{color:#b2b2b5;border-color:#b2b2b5}[data-theme=dark] .v[data-class=v] .vbtn:hover,.dark .v[data-class=v] .vbtn:hover,.theme__dark .v[data-class=v] .vbtn:hover,.night .v[data-class=v] .vbtn:hover{color:#66b1ff;border-color:#66b1ff}[data-theme=dark] .v[data-class=v] a:hover,.dark .v[data-class=v] a:hover,.theme__dark .v[data-class=v] a:hover,.night .v[data-class=v] a:hover{color:#d7191a}[data-theme=dark] .v[data-class=v] .vcards .vcard .vcontent.expand::before,.dark .v[data-class=v] .vcards .vcard .vcontent.expand::before,.theme__dark .v[data-class=v] .vcards .vcard .vcontent.expand::before,.night .v[data-class=v] .vcards .vcard .vcontent.expand::before{background:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.3)), to(rgba(0, 0, 0, 0.7)));background:linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7))}[data-theme=dark] .v[data-class=v] .vcards .vcard .vcontent.expand::after,.dark .v[data-class=v] .vcards .vcard .vcontent.expand::after,.theme__dark .v[data-class=v] .vcards .vcard .vcontent.expand::after,.night .v[data-class=v] .vcards .vcard .vcontent.expand::after{background:rgba(0,0,0,.7)}@media(prefers-color-scheme: dark){.v[data-class=v] .vinput,.v[data-class=v] .veditor,.v[data-class=v] p,.v[data-class=v] pre code,.v[data-class=v] .status-bar{color:#b2b2b5}.v[data-class=v] .vtime,.v[data-class=v] .vsys{color:#929298}.v[data-class=v] pre,.v[data-class=v] code,.v[data-class=v] pre code{color:#929298;background-color:#151414}.v[data-class=v] .vwrap{border-color:#b2b2b5}.v[data-class=v] .vicon{fill:#b2b2b5}.v[data-class=v] .vicon.actived{fill:#66b1ff}.v[data-class=v] .vbtn{color:#b2b2b5;border-color:#b2b2b5}.v[data-class=v] .vbtn:hover{color:#66b1ff;border-color:#66b1ff}.v[data-class=v] a:hover{color:#d7191a}.v[data-class=v] .vcards .vcard .vcontent.expand::before{background:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.3)), to(rgba(0, 0, 0, 0.7)));background:linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7))}.v[data-class=v] .vcards .vcard .vcontent.expand::after{background:rgba(0,0,0,.7)}}',""]),t.exports=e},function(t,e,n){"use strict";function r(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=function(t){return"/*# ".concat("sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(t)))))," */")}(r);return[n].concat(r.sources.map((function(t){return"/*# sourceURL=".concat(r.sourceRoot||"").concat(t," */")}))).concat([o]).join("\n")}return[n].join("\n")}t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=r(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;i<this.length;i++){var a=this[i][0];null!=a&&(o[a]=!0)}for(var s=0;s<t.length;s++){var u=[].concat(t[s]);r&&o[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},function(t,e,n){function r(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=h[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(l(r.parts[i],e))}else{var a=[];for(i=0;i<r.parts.length;i++)a.push(l(r.parts[i],e));h[r.id]={id:r.id,refs:1,parts:a}}}}function o(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],a=e.base?i[0]+e.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};r[a]?r[a].parts.push(s):n.push(r[a]={id:a,parts:[s]})}return n}function i(t,e){var n=m(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=b[b.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),b.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function a(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=b.indexOf(t);e>=0&&b.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",c(e,t.attrs),i(t,e),e}function u(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",c(e,t.attrs),i(t,e),e}function c(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function l(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var c=y++;n=g||(g=s(e)),r=f.bind(null,n,c,!1),o=f.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(e),r=d.bind(null,n,e),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(e),r=p.bind(null,n),o=function(){a(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}function f(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(i,a[e]):t.appendChild(i)}}function p(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function d(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=w(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var h={},v=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}((function(){return window&&document&&document.all&&!window.atob})),m=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t.call(this,n)),e[n]}}((function(t){return document.querySelector(t)})),g=null,y=0,b=[],w=n(107);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=v()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=o(t,e);return r(n,e),function(t){for(var i=[],a=0;a<n.length;a++){var s=n[a];(u=h[s.id]).refs--,i.push(u)}for(t&&r(o(t,e),e),a=0;a<i.length;a++){var u;if(0===(u=i[a]).refs){for(var c=0;c<u.parts.length;c++)u.parts[c]();delete h[u.id]}}}};var x=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(t,e,n){n(103),t.exports=n(34)}])},function(t,e,n){"use strict";n(202)},function(t,e,n){"use strict";var r=n(374),o=n(203),i=n(127),a=Object.prototype.hasOwnProperty,s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},u=Array.isArray,c=String.prototype.split,l=Array.prototype.push,f=function(t,e){l.apply(t,u(e)?e:[e])},p=Date.prototype.toISOString,d=i.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:o.encode,encodeValuesOnly:!1,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(t){return p.call(t)},skipNulls:!1,strictNullHandling:!1},v={},m=function t(e,n,i,a,s,l,p,d,m,g,y,b,w,x,_,E){for(var A,k=e,C=E,D=0,O=!1;void 0!==(C=C.get(v))&&!O;){var S=C.get(e);if(D+=1,void 0!==S){if(S===D)throw new RangeError("Cyclic object value");O=!0}void 0===C.get(v)&&(D=0)}if("function"==typeof d?k=d(n,k):k instanceof Date?k=y(k):"comma"===i&&u(k)&&(k=o.maybeMap(k,(function(t){return t instanceof Date?y(t):t}))),null===k){if(s)return p&&!x?p(n,h.encoder,_,"key",b):n;k=""}if("string"==typeof(A=k)||"number"==typeof A||"boolean"==typeof A||"symbol"==typeof A||"bigint"==typeof A||o.isBuffer(k)){if(p){var $=x?n:p(n,h.encoder,_,"key",b);if("comma"===i&&x){for(var j=c.call(String(k),","),T="",P=0;P<j.length;++P)T+=(0===P?"":",")+w(p(j[P],h.encoder,_,"value",b));return[w($)+(a&&u(k)&&1===j.length?"[]":"")+"="+T]}return[w($)+"="+w(p(k,h.encoder,_,"value",b))]}return[w(n)+"="+w(String(k))]}var B,F=[];if(void 0===k)return F;if("comma"===i&&u(k))B=[{value:k.length>0?k.join(",")||null:void 0}];else if(u(d))B=d;else{var I=Object.keys(k);B=m?I.sort(m):I}for(var M=a&&u(k)&&1===k.length?n+"[]":n,R=0;R<B.length;++R){var L=B[R],z="object"==typeof L&&void 0!==L.value?L.value:k[L];if(!l||null!==z){var N=u(k)?"function"==typeof i?i(M,L):M:M+(g?"."+L:"["+L+"]");E.set(e,D);var U=r();U.set(v,E),f(F,t(z,N,i,a,s,l,p,d,m,g,y,b,w,x,_,U))}}return F};t.exports=function(t,e){var n,o=t,c=function(t){if(!t)return h;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||h.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=i.default;if(void 0!==t.format){if(!a.call(i.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var r=i.formatters[n],o=h.filter;return("function"==typeof t.filter||u(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===t.allowDots?h.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:h.charsetSentinel,delimiter:void 0===t.delimiter?h.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:h.encode,encoder:"function"==typeof t.encoder?t.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:h.encodeValuesOnly,filter:o,format:n,formatter:r,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:h.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:h.strictNullHandling}}(e);"function"==typeof c.filter?o=(0,c.filter)("",o):u(c.filter)&&(n=c.filter);var l,p=[];if("object"!=typeof o||null===o)return"";l=e&&e.arrayFormat in s?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var d=s[l];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v="comma"===d&&e&&e.commaRoundTrip;n||(n=Object.keys(o)),c.sort&&n.sort(c.sort);for(var g=r(),y=0;y<n.length;++y){var b=n[y];c.skipNulls&&null===o[b]||f(p,m(o[b],b,d,v,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var w=p.join(c.delimiter),x=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?x+="utf8=%26%2310003%3B&":x+="utf8=%E2%9C%93&"),w.length>0?x+w:""}},function(t,e,n){"use strict";var r=n(125),o=n(379),i=n(381),a=r("%TypeError%"),s=r("%WeakMap%",!0),u=r("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),d=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),v=function(t,e){for(var n,r=t;null!==(n=r.next);r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n};t.exports=function(){var t,e,n,r={assert:function(t){if(!r.has(t))throw new a("Side channel does not contain "+i(t))},get:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(t)return c(t,r)}else if(u){if(e)return p(e,r)}else if(n)return function(t,e){var n=v(t,e);return n&&n.value}(n,r)},has:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(t)return f(t,r)}else if(u){if(e)return h(e,r)}else if(n)return function(t,e){return!!v(t,e)}(n,r);return!1},set:function(r,o){s&&r&&("object"==typeof r||"function"==typeof r)?(t||(t=new s),l(t,r,o)):u?(e||(e=new u),d(e,r,o)):(n||(n={key:{},next:null}),function(t,e,n){var r=v(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}}(n,r,o))}};return r}},function(t,e,n){"use strict";var r="undefined"!=typeof Symbol&&Symbol,o=n(376);t.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},function(t,e,n){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,e,n){"use strict";var r="Function.prototype.bind called on incompatible ",o=Array.prototype.slice,i=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==i.call(e))throw new TypeError(r+e);for(var n,a=o.call(arguments,1),s=function(){if(this instanceof n){var r=e.apply(this,a.concat(o.call(arguments)));return Object(r)===r?r:this}return e.apply(t,a.concat(o.call(arguments)))},u=Math.max(0,e.length-a.length),c=[],l=0;l<u;l++)c.push("$"+l);if(n=Function("binder","return function ("+c.join(",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var f=function(){};f.prototype=e.prototype,n.prototype=new f,f.prototype=null}return n}},function(t,e,n){"use strict";var r=n(126);t.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},function(t,e,n){"use strict";var r=n(125),o=n(380),i=o(r("String.prototype.indexOf"));t.exports=function(t,e){var n=r(t,!!e);return"function"==typeof n&&i(t,".prototype.")>-1?o(n):n}},function(t,e,n){"use strict";var r=n(126),o=n(125),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||r.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(r,a,arguments);if(u&&c){var n=u(e,"length");n.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return s(r,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},function(t,e,n){var r="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&r?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=r&&o&&"function"==typeof o.get?o.get:null,a=r&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,v=Object.prototype.toString,m=Function.prototype.toString,g=String.prototype.match,y=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,_=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,k=Array.prototype.slice,C=Math.floor,D="function"==typeof BigInt?BigInt.prototype.valueOf:null,O=Object.getOwnPropertySymbols,S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,$="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===$||"symbol")?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,P=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function B(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||_.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var r=t<0?-C(-t):C(t);if(r!==t){var o=String(r),i=y.call(e,o.length+1);return b.call(o,n,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(e,n,"$&_")}var F=n(382),I=F.custom,M=U(I)?I:null;function R(t,e,n){var r="double"===(n.quoteStyle||e)?'"':"'";return r+t+r}function L(t){return b.call(String(t),/"/g,""")}function z(t){return!("[object Array]"!==q(t)||j&&"object"==typeof t&&j in t)}function N(t){return!("[object RegExp]"!==q(t)||j&&"object"==typeof t&&j in t)}function U(t){if($)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!S)return!1;try{return S.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,r,o){var s=n||{};if(H(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(H(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!H(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(H(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(H(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var v=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return function t(e,n){if(e.length>n.maxStringLength){var r=e.length-n.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return t(y.call(e,0,n.maxStringLength),n)+o}return R(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",n)}(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return v?B(e,w):w}if("bigint"==typeof e){var _=String(e)+"n";return v?B(e,_):_}var C=void 0===s.depth?5:s.depth;if(void 0===r&&(r=0),r>=C&&C>0&&"object"==typeof e)return z(e)?"[Array]":"[Object]";var O=function(t,e){var n;if("\t"===t.indent)n="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;n=A.call(Array(t.indent+1)," ")}return{base:n,prev:A.call(Array(e+1),n)}}(s,r);if(void 0===o)o=[];else if(W(o,e)>=0)return"[Circular]";function I(e,n,i){if(n&&(o=k.call(o)).push(n),i){var a={depth:s.depth};return H(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,r+1,o)}return t(e,s,r+1,o)}if("function"==typeof e&&!N(e)){var V=function(t){if(t.name)return t.name;var e=g.call(m.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),X=Z(e,I);return"[Function"+(V?": "+V:" (anonymous)")+"]"+(X.length>0?" { "+A.call(X,", ")+" }":"")}if(U(e)){var tt=$?b.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):S.call(e);return"object"!=typeof e||$?tt:G(tt)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var et="<"+x.call(String(e.nodeName)),nt=e.attributes||[],rt=0;rt<nt.length;rt++)et+=" "+nt[rt].name+"="+R(L(nt[rt].value),"double",s);return et+=">",e.childNodes&&e.childNodes.length&&(et+="..."),et+="</"+x.call(String(e.nodeName))+">"}if(z(e)){if(0===e.length)return"[]";var ot=Z(e,I);return O&&!function(t){for(var e=0;e<t.length;e++)if(W(t[e],"\n")>=0)return!1;return!0}(ot)?"["+K(ot,O)+"]":"[ "+A.call(ot,", ")+" ]"}if(function(t){return!("[object Error]"!==q(t)||j&&"object"==typeof t&&j in t)}(e)){var it=Z(e,I);return"cause"in Error.prototype||!("cause"in e)||T.call(e,"cause")?0===it.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(it,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+I(e.cause),it),", ")+" }"}if("object"==typeof e&&u){if(M&&"function"==typeof e[M]&&F)return F(e,{depth:C-r});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var at=[];return a.call(e,(function(t,n){at.push(I(n,e,!0)+" => "+I(t,e))})),Y("Map",i.call(e),at,O)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l.call(e,(function(t){st.push(I(t,e))})),Y("Set",c.call(e),st,O)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Q("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Q("WeakSet");if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{return d.call(t),!0}catch(t){}return!1}(e))return Q("WeakRef");if(function(t){return!("[object Number]"!==q(t)||j&&"object"==typeof t&&j in t)}(e))return G(I(Number(e)));if(function(t){if(!t||"object"!=typeof t||!D)return!1;try{return D.call(t),!0}catch(t){}return!1}(e))return G(I(D.call(e)));if(function(t){return!("[object Boolean]"!==q(t)||j&&"object"==typeof t&&j in t)}(e))return G(h.call(e));if(function(t){return!("[object String]"!==q(t)||j&&"object"==typeof t&&j in t)}(e))return G(I(String(e)));if(!function(t){return!("[object Date]"!==q(t)||j&&"object"==typeof t&&j in t)}(e)&&!N(e)){var ut=Z(e,I),ct=P?P(e)===Object.prototype:e instanceof Object||e.constructor===Object,lt=e instanceof Object?"":"null prototype",ft=!ct&&j&&Object(e)===e&&j in e?y.call(q(e),8,-1):lt?"Object":"",pt=(ct||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ft||lt?"["+A.call(E.call([],ft||[],lt||[]),": ")+"] ":"");return 0===ut.length?pt+"{}":O?pt+"{"+K(ut,O)+"}":pt+"{ "+A.call(ut,", ")+" }"}return String(e)};var V=Object.prototype.hasOwnProperty||function(t){return t in this};function H(t,e){return V.call(t,e)}function q(t){return v.call(t)}function W(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}function J(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function G(t){return"Object("+t+")"}function Q(t){return t+" { ? }"}function Y(t,e,n,r){return t+" ("+e+") {"+(r?K(n,r):A.call(n,", "))+"}"}function K(t,e){if(0===t.length)return"";var n="\n"+e.prev+e.base;return n+A.call(t,","+n)+"\n"+e.prev}function Z(t,e){var n=z(t),r=[];if(n){r.length=t.length;for(var o=0;o<t.length;o++)r[o]=H(t,o)?e(t[o],t):""}var i,a="function"==typeof O?O(t):[];if($){i={};for(var s=0;s<a.length;s++)i["$"+a[s]]=a[s]}for(var u in t)H(t,u)&&(n&&String(Number(u))===u&&u<t.length||$&&i["$"+u]instanceof Symbol||(_.call(/[^\w$]/,u)?r.push(e(u,t)+": "+e(t[u],t)):r.push(u+": "+e(t[u],t))));if("function"==typeof O)for(var c=0;c<a.length;c++)T.call(t,a[c])&&r.push("["+e(a[c])+"]: "+e(t[a[c]],t));return r}},function(t,e){},function(t,e,n){"use strict";var r=n(203),o=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},u=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},c=function(t,e,n,r){if(t){var i=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,a=/(\[[^[\]]*])/g,s=n.depth>0&&/(\[[^[\]]*])/.exec(i),c=s?i.slice(0,s.index):i,l=[];if(c){if(!n.plainObjects&&o.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var f=0;n.depth>0&&null!==(s=a.exec(i))&&f<n.depth;){if(f+=1,!n.plainObjects&&o.call(Object.prototype,s[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(s[1])}return s&&l.push("["+i.slice(s.index)+"]"),function(t,e,n,r){for(var o=r?e:u(e,n),i=t.length-1;i>=0;--i){var a,s=t[i];if("[]"===s&&n.parseArrays)a=[].concat(o);else{a=n.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,l=parseInt(c,10);n.parseArrays||""!==c?!isNaN(l)&&s!==c&&String(l)===c&&l>=0&&n.parseArrays&&l<=n.arrayLimit?(a=[])[l]=o:"__proto__"!==c&&(a[c]=o):a={0:o}}o=a}return o}(l,e,n,r)}};t.exports=function(t,e){var n=function(t){if(!t)return a;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?a.charset:t.charset;return{allowDots:void 0===t.allowDots?a.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||r.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling}}(e);if(""===t||null==t)return n.plainObjects?Object.create(null):{};for(var l="string"==typeof t?function(t,e){var n,c={},l=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,f=e.parameterLimit===1/0?void 0:e.parameterLimit,p=l.split(e.delimiter,f),d=-1,h=e.charset;if(e.charsetSentinel)for(n=0;n<p.length;++n)0===p[n].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[n]?h="utf-8":"utf8=%26%2310003%3B"===p[n]&&(h="iso-8859-1"),d=n,n=p.length);for(n=0;n<p.length;++n)if(n!==d){var v,m,g=p[n],y=g.indexOf("]="),b=-1===y?g.indexOf("="):y+1;-1===b?(v=e.decoder(g,a.decoder,h,"key"),m=e.strictNullHandling?null:""):(v=e.decoder(g.slice(0,b),a.decoder,h,"key"),m=r.maybeMap(u(g.slice(b+1),e),(function(t){return e.decoder(t,a.decoder,h,"value")}))),m&&e.interpretNumericEntities&&"iso-8859-1"===h&&(m=s(m)),g.indexOf("[]=")>-1&&(m=i(m)?[m]:m),o.call(c,v)?c[v]=r.combine(c[v],m):c[v]=m}return c}(t,n):t,f=n.plainObjects?Object.create(null):{},p=Object.keys(l),d=0;d<p.length;++d){var h=p[d],v=c(h,l[h],n,"string"==typeof t);f=r.merge(f,v,n)}return!0===n.allowSparse?f:r.compact(f)}},function(t,e,n){var r=n(36),o=n(386),i=n(387);t.exports=function(t){var e=r(t);return i(e,o(e))+1}},function(t,e){t.exports=function(t){var e=new Date(t.getTime()),n=e.getTimezoneOffset();return e.setSeconds(0,0),6e4*n+e.getTime()%6e4}},function(t,e,n){var r=n(36);t.exports=function(t){var e=r(t),n=new Date(0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}},function(t,e,n){var r=n(388);t.exports=function(t,e){var n=r(t),o=r(e),i=n.getTime()-6e4*n.getTimezoneOffset(),a=o.getTime()-6e4*o.getTimezoneOffset();return Math.round((i-a)/864e5)}},function(t,e,n){var r=n(36);t.exports=function(t){var e=r(t);return e.setHours(0,0,0,0),e}},function(t,e,n){var r=n(36),o=n(128),i=n(391);t.exports=function(t){var e=r(t),n=o(e).getTime()-i(e).getTime();return Math.round(n/6048e5)+1}},function(t,e,n){var r=n(36);t.exports=function(t,e){var n=e&&Number(e.weekStartsOn)||0,o=r(t),i=o.getDay(),a=(i<n?7:0)+i-n;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}},function(t,e,n){var r=n(205),o=n(128);t.exports=function(t){var e=r(t),n=new Date(0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),o(n)}},function(t,e,n){var r=n(204);t.exports=function(t){if(r(t))return!isNaN(t);throw new TypeError(toString.call(t)+" is not an instance of Date")}},function(t,e,n){var r=n(394),o=n(395);t.exports={distanceInWords:r(),format:o()}},function(t,e){t.exports=function(){var t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};return{localize:function(e,n,r){var o;return r=r||{},o="string"==typeof t[e]?t[e]:1===n?t[e].one:t[e].other.replace("{{count}}",n),r.addSuffix?r.comparison>0?"in "+o:o+" ago":o}}}},function(t,e,n){var r=n(396);t.exports=function(){var t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Su","Mo","Tu","We","Th","Fr","Sa"],o=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],a=["AM","PM"],s=["am","pm"],u=["a.m.","p.m."],c={MMM:function(e){return t[e.getMonth()]},MMMM:function(t){return e[t.getMonth()]},dd:function(t){return n[t.getDay()]},ddd:function(t){return o[t.getDay()]},dddd:function(t){return i[t.getDay()]},A:function(t){return t.getHours()/12>=1?a[1]:a[0]},a:function(t){return t.getHours()/12>=1?s[1]:s[0]},aa:function(t){return t.getHours()/12>=1?u[1]:u[0]}};return["M","D","DDD","d","Q","W"].forEach((function(t){c[t+"o"]=function(e,n){return function(t){var e=t%100;if(e>20||e<10)switch(e%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"}(n[t](e))}})),{formatters:c,formattingTokensRegExp:r(c)}}},function(t,e){var n=["M","MM","Q","D","DD","DDD","DDDD","d","E","W","WW","YY","YYYY","GG","GGGG","H","HH","h","hh","m","mm","s","ss","S","SS","SSS","Z","ZZ","X","x"];t.exports=function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);var o=n.concat(e).sort().reverse();return new RegExp("(\\[[^\\[]*\\])|(\\\\)?("+o.join("|")+"|.)","g")}},function(t,e,n){"use strict";var r=n(13),o=n(206),i=n(398),a=n(212);function s(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var u=s(n(129));u.Axios=i,u.create=function(t){return s(a(u.defaults,t))},u.Cancel=n(213),u.CancelToken=n(412),u.isCancel=n(211),u.all=function(t){return Promise.all(t)},u.spread=n(413),u.isAxiosError=n(414),t.exports=u,t.exports.default=u},function(t,e,n){"use strict";var r=n(13),o=n(207),i=n(399),a=n(400),s=n(212),u=n(410),c=u.validators;function l(t){this.defaults=t,this.interceptors={request:new i,response:new i}}l.prototype.request=function(t){"string"==typeof t?(t=arguments[1]||{}).url=arguments[0]:t=t||{},(t=s(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&u.assertOptions(e,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var o,i=[];if(this.interceptors.response.forEach((function(t){i.push(t.fulfilled,t.rejected)})),!r){var l=[a,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(i),o=Promise.resolve(t);l.length;)o=o.then(l.shift(),l.shift());return o}for(var f=t;n.length;){var p=n.shift(),d=n.shift();try{f=p(f)}catch(t){d(t);break}}try{o=a(f)}catch(t){return Promise.reject(t)}for(;i.length;)o=o.then(i.shift(),i.shift());return o},l.prototype.getUri=function(t){return t=s(this.defaults,t),o(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){l.prototype[t]=function(e,n){return this.request(s(n||{},{method:t,url:e,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){l.prototype[t]=function(e,n,r){return this.request(s(r||{},{method:t,url:e,data:n}))}})),t.exports=l},function(t,e,n){"use strict";var r=n(13);function o(){this.handlers=[]}o.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=o},function(t,e,n){"use strict";var r=n(13),o=n(401),i=n(211),a=n(129);function s(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return s(t),t.headers=t.headers||{},t.data=o.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return s(t),e.data=o.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return i(e)||(s(t),e&&e.response&&(e.response.data=o.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,n){"use strict";var r=n(13),o=n(129);t.exports=function(t,e,n){var i=this||o;return r.forEach(n,(function(n){t=n.call(i,t,e)})),t}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e){r.forEach(t,(function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])}))}},function(t,e,n){"use strict";var r=n(210);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";var r=n(13);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(406),o=n(407);t.exports=function(t,e){return t&&!r(e)?o(t,e):e}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(13),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,a={};return t?(r.forEach(t.split("\n"),(function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(a[e]&&o.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}})),a):a}},function(t,e,n){"use strict";var r=n(13);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r=n(411),o={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){o[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var i={},a=r.version.split(".");function s(t,e){for(var n=e?e.split("."):a,r=t.split("."),o=0;o<3;o++){if(n[o]>r[o])return!0;if(n[o]<r[o])return!1}return!1}o.transitional=function(t,e,n){var o=e&&s(e);function a(t,e){return"[Axios v"+r.version+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return function(n,r,s){if(!1===t)throw new Error(a(r," has been removed in "+e));return o&&!i[r]&&(i[r]=!0,console.warn(a(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,r,s)}},t.exports={isOlderVersion:s,assertOptions:function(t,e,n){if("object"!=typeof t)throw new TypeError("options must be an object");for(var r=Object.keys(t),o=r.length;o-- >0;){var i=r[o],a=e[i];if(a){var s=t[i],u=void 0===s||a(s,i,t);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},function(t){t.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(t,e,n){"use strict";var r=n(213);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new r(t),e(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o((function(e){t=e})),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},function(t,e,n){},function(t,e,n){"use strict";n(214)},function(t,e,n){},function(t,e,n){var r;function o(t){function n(){if(n.enabled){var t=n,o=+new Date,i=o-(r||o);t.diff=i,t.prev=r,t.curr=o,r=o;for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=e.coerce(a[0]),"string"!=typeof a[0]&&a.unshift("%O");var u=0;a[0]=a[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return n;u++;var o=e.formatters[r];if("function"==typeof o){var i=a[u];n=o.call(t,i),a.splice(u,1),u--}return n})),e.formatArgs.call(t,a);var c=n.log||e.log||console.log.bind(console);c.apply(t,a)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}(t),"function"==typeof e.init&&e.init(n),n}(e=t.exports=o.debug=o.default=o).coerce=function(t){return t instanceof Error?t.stack||t.message:t},e.disable=function(){e.enable("")},e.enable=function(t){e.save(t),e.names=[],e.skips=[];for(var n=("string"==typeof t?t:"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&("-"===(t=n[o].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(419),e.names=[],e.skips=[],e.formatters={}},function(t,e){var n=1e3,r=6e4,o=60*r,i=24*o;function a(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}t.exports=function(t,e){e=e||{};var s,u=typeof t;if("string"===u&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(!e)return;var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===u&&!1===isNaN(t))return e.long?a(s=t,i,"day")||a(s,o,"hour")||a(s,r,"minute")||a(s,n,"second")||s+" ms":function(t){if(t>=i)return Math.round(t/i)+"d";if(t>=o)return Math.round(t/o)+"h";if(t>=r)return Math.round(t/r)+"m";if(t>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){"use strict";n(218)},function(t,e,n){"use strict";n(219)},function(t,e,n){"use strict";n.r(e);n(139),n(239),n(248),n(250),n(17);function r(t,e,n,r,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function s(t){r(a,o,i,s,u,"next",t)}function u(t){r(a,o,i,s,u,"throw",t)}s(void 0)}))}}n(162),n(32),n(23),n(25),n(37),n(20);var i=n(0);function a(t,e){for(var n in e)t[n]=e[n];return t}var s=/[!'()*]/g,u=function(t){return"%"+t.charCodeAt(0).toString(16)},c=/%2C/g,l=function(t){return encodeURIComponent(t).replace(s,u).replace(c,",")};function f(t){try{return decodeURIComponent(t)}catch(t){0}return t}var p=function(t){return null==t||"object"==typeof t?t:String(t)};function d(t){var e={};return(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach((function(t){var n=t.replace(/\+/g," ").split("="),r=f(n.shift()),o=n.length>0?f(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]})),e):e}function h(t){var e=t?Object.keys(t).map((function(e){var n=t[e];if(void 0===n)return"";if(null===n)return l(e);if(Array.isArray(n)){var r=[];return n.forEach((function(t){void 0!==t&&(null===t?r.push(l(e)):r.push(l(e)+"="+l(t)))})),r.join("&")}return l(e)+"="+l(n)})).filter((function(t){return t.length>0})).join("&"):null;return e?"?"+e:""}var v=/\/?$/;function m(t,e,n,r){var o=r&&r.options.stringifyQuery,i=e.query||{};try{i=g(i)}catch(t){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:w(e,o),matched:t?b(t):[]};return n&&(a.redirectedFrom=w(n,o)),Object.freeze(a)}function g(t){if(Array.isArray(t))return t.map(g);if(t&&"object"==typeof t){var e={};for(var n in t)e[n]=g(t[n]);return e}return t}var y=m(null,{path:"/"});function b(t){for(var e=[];t;)e.unshift(t),t=t.parent;return e}function w(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var o=t.hash;return void 0===o&&(o=""),(n||"/")+(e||h)(r)+o}function x(t,e,n){return e===y?t===e:!!e&&(t.path&&e.path?t.path.replace(v,"")===e.path.replace(v,"")&&(n||t.hash===e.hash&&_(t.query,e.query)):!(!t.name||!e.name)&&(t.name===e.name&&(n||t.hash===e.hash&&_(t.query,e.query)&&_(t.params,e.params))))}function _(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t).sort(),r=Object.keys(e).sort();return n.length===r.length&&n.every((function(n,o){var i=t[n];if(r[o]!==n)return!1;var a=e[n];return null==i||null==a?i===a:"object"==typeof i&&"object"==typeof a?_(i,a):String(i)===String(a)}))}function E(t){for(var e=0;e<t.matched.length;e++){var n=t.matched[e];for(var r in n.instances){var o=n.instances[r],i=n.enteredCbs[r];if(o&&i){delete n.enteredCbs[r];for(var a=0;a<i.length;a++)o._isBeingDestroyed||i[a](o)}}}}var A={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,o=e.parent,i=e.data;i.routerView=!0;for(var s=o.$createElement,u=n.name,c=o.$route,l=o._routerViewCache||(o._routerViewCache={}),f=0,p=!1;o&&o._routerRoot!==o;){var d=o.$vnode?o.$vnode.data:{};d.routerView&&f++,d.keepAlive&&o._directInactive&&o._inactive&&(p=!0),o=o.$parent}if(i.routerViewDepth=f,p){var h=l[u],v=h&&h.component;return v?(h.configProps&&k(v,i,h.route,h.configProps),s(v,i,r)):s()}var m=c.matched[f],g=m&&m.components[u];if(!m||!g)return l[u]=null,s();l[u]={component:g},i.registerRouteInstance=function(t,e){var n=m.instances[u];(e&&n!==t||!e&&n===t)&&(m.instances[u]=e)},(i.hook||(i.hook={})).prepatch=function(t,e){m.instances[u]=e.componentInstance},i.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==m.instances[u]&&(m.instances[u]=t.componentInstance),E(c)};var y=m.props&&m.props[u];return y&&(a(l[u],{route:c,configProps:y}),k(g,i,c,y)),s(g,i,r)}};function k(t,e,n,r){var o=e.props=function(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}(n,r);if(o){o=e.props=a({},o);var i=e.attrs=e.attrs||{};for(var s in o)t.props&&s in t.props||(i[s]=o[s],delete o[s])}}function C(t,e,n){var r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;var o=e.split("/");n&&o[o.length-1]||o.pop();for(var i=t.replace(/^\//,"").split("/"),a=0;a<i.length;a++){var s=i[a];".."===s?o.pop():"."!==s&&o.push(s)}return""!==o[0]&&o.unshift(""),o.join("/")}function D(t){return t.replace(/\/\//g,"/")}var O=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},S=V,$=F,j=function(t,e){return M(F(t,e),e)},T=M,P=U,B=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function F(t,e){for(var n,r=[],o=0,i=0,a="",s=e&&e.delimiter||"/";null!=(n=B.exec(t));){var u=n[0],c=n[1],l=n.index;if(a+=t.slice(i,l),i=l+u.length,c)a+=c[1];else{var f=t[i],p=n[2],d=n[3],h=n[4],v=n[5],m=n[6],g=n[7];a&&(r.push(a),a="");var y=null!=p&&null!=f&&f!==p,b="+"===m||"*"===m,w="?"===m||"*"===m,x=n[2]||s,_=h||v;r.push({name:d||o++,prefix:p||"",delimiter:x,optional:w,repeat:b,partial:y,asterisk:!!g,pattern:_?L(_):g?".*":"[^"+R(x)+"]+?"})}}return i<t.length&&(a+=t.substr(i)),a&&r.push(a),r}function I(t){return encodeURI(t).replace(/[\/?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}))}function M(t,e){for(var n=new Array(t.length),r=0;r<t.length;r++)"object"==typeof t[r]&&(n[r]=new RegExp("^(?:"+t[r].pattern+")$",N(e)));return function(e,r){for(var o="",i=e||{},a=(r||{}).pretty?I:encodeURIComponent,s=0;s<t.length;s++){var u=t[s];if("string"!=typeof u){var c,l=i[u.name];if(null==l){if(u.optional){u.partial&&(o+=u.prefix);continue}throw new TypeError('Expected "'+u.name+'" to be defined')}if(O(l)){if(!u.repeat)throw new TypeError('Expected "'+u.name+'" to not repeat, but received `'+JSON.stringify(l)+"`");if(0===l.length){if(u.optional)continue;throw new TypeError('Expected "'+u.name+'" to not be empty')}for(var f=0;f<l.length;f++){if(c=a(l[f]),!n[s].test(c))throw new TypeError('Expected all "'+u.name+'" to match "'+u.pattern+'", but received `'+JSON.stringify(c)+"`");o+=(0===f?u.prefix:u.delimiter)+c}}else{if(c=u.asterisk?encodeURI(l).replace(/[?#]/g,(function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})):a(l),!n[s].test(c))throw new TypeError('Expected "'+u.name+'" to match "'+u.pattern+'", but received "'+c+'"');o+=u.prefix+c}}else o+=u}return o}}function R(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function L(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function z(t,e){return t.keys=e,t}function N(t){return t&&t.sensitive?"":"i"}function U(t,e,n){O(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,i="",a=0;a<t.length;a++){var s=t[a];if("string"==typeof s)i+=R(s);else{var u=R(s.prefix),c="(?:"+s.pattern+")";e.push(s),s.repeat&&(c+="(?:"+u+c+")*"),i+=c=s.optional?s.partial?u+"("+c+")?":"(?:"+u+"("+c+"))?":u+"("+c+")"}}var l=R(n.delimiter||"/"),f=i.slice(-l.length)===l;return r||(i=(f?i.slice(0,-l.length):i)+"(?:"+l+"(?=$))?"),i+=o?"$":r&&f?"":"(?="+l+"|$)",z(new RegExp("^"+i,N(n)),e)}function V(t,e,n){return O(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return z(t,e)}(t,e):O(t)?function(t,e,n){for(var r=[],o=0;o<t.length;o++)r.push(V(t[o],e,n).source);return z(new RegExp("(?:"+r.join("|")+")",N(n)),e)}(t,e,n):function(t,e,n){return U(F(t,n),e,n)}(t,e,n)}S.parse=$,S.compile=j,S.tokensToFunction=T,S.tokensToRegExp=P;var H=Object.create(null);function q(t,e,n){e=e||{};try{var r=H[t]||(H[t]=S.compile(t));return"string"==typeof e.pathMatch&&(e[0]=e.pathMatch),r(e,{pretty:!0})}catch(t){return""}finally{delete e[0]}}function W(t,e,n,r){var o="string"==typeof t?{path:t}:t;if(o._normalized)return o;if(o.name){var i=(o=a({},t)).params;return i&&"object"==typeof i&&(o.params=a({},i)),o}if(!o.path&&o.params&&e){(o=a({},o))._normalized=!0;var s=a(a({},e.params),o.params);if(e.name)o.name=e.name,o.params=s;else if(e.matched.length){var u=e.matched[e.matched.length-1].path;o.path=q(u,s,e.path)}else 0;return o}var c=function(t){var e="",n="",r=t.indexOf("#");r>=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}(o.path||""),l=e&&e.path||"/",f=c.path?C(c.path,l,n||o.append):l,h=function(t,e,n){void 0===e&&(e={});var r,o=n||d;try{r=o(t||"")}catch(t){r={}}for(var i in e){var a=e[i];r[i]=Array.isArray(a)?a.map(p):p(a)}return r}(c.query,o.query,r&&r.options.parseQuery),v=o.hash||c.hash;return v&&"#"!==v.charAt(0)&&(v="#"+v),{_normalized:!0,path:f,query:h,hash:v}}var J,G=function(){},Q={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),i=o.location,s=o.route,u=o.href,c={},l=n.options.linkActiveClass,f=n.options.linkExactActiveClass,p=null==l?"router-link-active":l,d=null==f?"router-link-exact-active":f,h=null==this.activeClass?p:this.activeClass,g=null==this.exactActiveClass?d:this.exactActiveClass,y=s.redirectedFrom?m(null,W(s.redirectedFrom),null,n):s;c[g]=x(r,y,this.exactPath),c[h]=this.exact||this.exactPath?c[g]:function(t,e){return 0===t.path.replace(v,"/").indexOf(e.path.replace(v,"/"))&&(!e.hash||t.hash===e.hash)&&function(t,e){for(var n in e)if(!(n in t))return!1;return!0}(t.query,e.query)}(r,y);var b=c[g]?this.ariaCurrentValue:null,w=function(t){Y(t)&&(e.replace?n.replace(i,G):n.push(i,G))},_={click:Y};Array.isArray(this.event)?this.event.forEach((function(t){_[t]=w})):_[this.event]=w;var E={class:c},A=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:u,route:s,navigate:w,isActive:c[h],isExactActive:c[g]});if(A){if(1===A.length)return A[0];if(A.length>1||!A.length)return 0===A.length?t():t("span",{},A)}if("a"===this.tag)E.on=_,E.attrs={href:u,"aria-current":b};else{var k=function t(e){var n;if(e)for(var r=0;r<e.length;r++){if("a"===(n=e[r]).tag)return n;if(n.children&&(n=t(n.children)))return n}}(this.$slots.default);if(k){k.isStatic=!1;var C=k.data=a({},k.data);for(var D in C.on=C.on||{},C.on){var O=C.on[D];D in _&&(C.on[D]=Array.isArray(O)?O:[O])}for(var S in _)S in C.on?C.on[S].push(_[S]):C.on[S]=w;var $=k.data.attrs=a({},k.data.attrs);$.href=u,$["aria-current"]=b}else E.on=_}return t(this.tag,E,this.$slots.default)}};function Y(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.defaultPrevented||void 0!==t.button&&0!==t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}var K="undefined"!=typeof window;function Z(t,e,n,r,o){var i=e||[],a=n||Object.create(null),s=r||Object.create(null);t.forEach((function(t){!function t(e,n,r,o,i,a){var s=o.path,u=o.name;0;var c=o.pathToRegexpOptions||{},l=function(t,e,n){n||(t=t.replace(/\/$/,""));if("/"===t[0])return t;if(null==e)return t;return D(e.path+"/"+t)}(s,i,c.strict);"boolean"==typeof o.caseSensitive&&(c.sensitive=o.caseSensitive);var f={path:l,regex:X(l,c),components:o.components||{default:o.component},alias:o.alias?"string"==typeof o.alias?[o.alias]:o.alias:[],instances:{},enteredCbs:{},name:u,parent:i,matchAs:a,redirect:o.redirect,beforeEnter:o.beforeEnter,meta:o.meta||{},props:null==o.props?{}:o.components?o.props:{default:o.props}};o.children&&o.children.forEach((function(o){var i=a?D(a+"/"+o.path):void 0;t(e,n,r,o,f,i)}));n[f.path]||(e.push(f.path),n[f.path]=f);if(void 0!==o.alias)for(var p=Array.isArray(o.alias)?o.alias:[o.alias],d=0;d<p.length;++d){0;var h={path:p[d],children:o.children};t(e,n,r,h,i,f.path||"/")}u&&(r[u]||(r[u]=f))}(i,a,s,t,o)}));for(var u=0,c=i.length;u<c;u++)"*"===i[u]&&(i.push(i.splice(u,1)[0]),c--,u--);return{pathList:i,pathMap:a,nameMap:s}}function X(t,e){return S(t,[],e)}function tt(t,e){var n=Z(t),r=n.pathList,o=n.pathMap,i=n.nameMap;function a(t,n,a){var s=W(t,n,!1,e),c=s.name;if(c){var l=i[c];if(!l)return u(null,s);var f=l.regex.keys.filter((function(t){return!t.optional})).map((function(t){return t.name}));if("object"!=typeof s.params&&(s.params={}),n&&"object"==typeof n.params)for(var p in n.params)!(p in s.params)&&f.indexOf(p)>-1&&(s.params[p]=n.params[p]);return s.path=q(l.path,s.params),u(l,s,a)}if(s.path){s.params={};for(var d=0;d<r.length;d++){var h=r[d],v=o[h];if(et(v.regex,s.path,s.params))return u(v,s,a)}}return u(null,s)}function s(t,n){var r=t.redirect,o="function"==typeof r?r(m(t,n,null,e)):r;if("string"==typeof o&&(o={path:o}),!o||"object"!=typeof o)return u(null,n);var s=o,c=s.name,l=s.path,f=n.query,p=n.hash,d=n.params;if(f=s.hasOwnProperty("query")?s.query:f,p=s.hasOwnProperty("hash")?s.hash:p,d=s.hasOwnProperty("params")?s.params:d,c){i[c];return a({_normalized:!0,name:c,query:f,hash:p,params:d},void 0,n)}if(l){var h=function(t,e){return C(t,e.parent?e.parent.path:"/",!0)}(l,t);return a({_normalized:!0,path:q(h,d),query:f,hash:p},void 0,n)}return u(null,n)}function u(t,n,r){return t&&t.redirect?s(t,r||n):t&&t.matchAs?function(t,e,n){var r=a({_normalized:!0,path:q(n,e.params)});if(r){var o=r.matched,i=o[o.length-1];return e.params=r.params,u(i,e)}return u(null,e)}(0,n,t.matchAs):m(t,n,r,e)}return{match:a,addRoute:function(t,e){var n="object"!=typeof t?i[t]:void 0;Z([e||t],r,o,i,n),n&&Z(n.alias.map((function(t){return{path:t,children:[e]}})),r,o,i,n)},getRoutes:function(){return r.map((function(t){return o[t]}))},addRoutes:function(t){Z(t,r,o,i)}}}function et(t,e,n){var r=e.match(t);if(!r)return!1;if(!n)return!0;for(var o=1,i=r.length;o<i;++o){var a=t.keys[o-1];a&&(n[a.name||"pathMatch"]="string"==typeof r[o]?f(r[o]):r[o])}return!0}var nt=K&&window.performance&&window.performance.now?window.performance:Date;function rt(){return nt.now().toFixed(3)}var ot=rt();function it(){return ot}function at(t){return ot=t}var st=Object.create(null);function ut(){"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual");var t=window.location.protocol+"//"+window.location.host,e=window.location.href.replace(t,""),n=a({},window.history.state);return n.key=it(),window.history.replaceState(n,"",e),window.addEventListener("popstate",ft),function(){window.removeEventListener("popstate",ft)}}function ct(t,e,n,r){if(t.app){var o=t.options.scrollBehavior;o&&t.app.$nextTick((function(){var i=function(){var t=it();if(t)return st[t]}(),a=o.call(t,e,n,r?i:null);a&&("function"==typeof a.then?a.then((function(t){mt(t,i)})).catch((function(t){0})):mt(a,i))}))}}function lt(){var t=it();t&&(st[t]={x:window.pageXOffset,y:window.pageYOffset})}function ft(t){lt(),t.state&&t.state.key&&at(t.state.key)}function pt(t){return ht(t.x)||ht(t.y)}function dt(t){return{x:ht(t.x)?t.x:window.pageXOffset,y:ht(t.y)?t.y:window.pageYOffset}}function ht(t){return"number"==typeof t}var vt=/^#\d/;function mt(t,e){var n,r="object"==typeof t;if(r&&"string"==typeof t.selector){var o=vt.test(t.selector)?document.getElementById(t.selector.slice(1)):document.querySelector(t.selector);if(o){var i=t.offset&&"object"==typeof t.offset?t.offset:{};e=function(t,e){var n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{x:r.left-n.left-e.x,y:r.top-n.top-e.y}}(o,i={x:ht((n=i).x)?n.x:0,y:ht(n.y)?n.y:0})}else pt(t)&&(e=dt(t))}else r&&pt(t)&&(e=dt(t));e&&("scrollBehavior"in document.documentElement.style?window.scrollTo({left:e.x,top:e.y,behavior:t.behavior}):window.scrollTo(e.x,e.y))}var gt,yt=K&&((-1===(gt=window.navigator.userAgent).indexOf("Android 2.")&&-1===gt.indexOf("Android 4.0")||-1===gt.indexOf("Mobile Safari")||-1!==gt.indexOf("Chrome")||-1!==gt.indexOf("Windows Phone"))&&window.history&&"function"==typeof window.history.pushState);function bt(t,e){lt();var n=window.history;try{if(e){var r=a({},n.state);r.key=it(),n.replaceState(r,"",t)}else n.pushState({key:at(rt())},"",t)}catch(n){window.location[e?"replace":"assign"](t)}}function wt(t){bt(t,!0)}function xt(t,e,n){var r=function(o){o>=t.length?n():t[o]?e(t[o],(function(){r(o+1)})):r(o+1)};r(0)}var _t={redirected:2,aborted:4,cancelled:8,duplicated:16};function Et(t,e){return kt(t,e,_t.redirected,'Redirected when going from "'+t.fullPath+'" to "'+function(t){if("string"==typeof t)return t;if("path"in t)return t.path;var e={};return Ct.forEach((function(n){n in t&&(e[n]=t[n])})),JSON.stringify(e,null,2)}(e)+'" via a navigation guard.')}function At(t,e){return kt(t,e,_t.cancelled,'Navigation cancelled from "'+t.fullPath+'" to "'+e.fullPath+'" with a new navigation.')}function kt(t,e,n,r){var o=new Error(r);return o._isRouter=!0,o.from=t,o.to=e,o.type=n,o}var Ct=["params","query","hash"];function Dt(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function Ot(t,e){return Dt(t)&&t._isRouter&&(null==e||t.type===e)}function St(t){return function(e,n,r){var o=!1,i=0,a=null;$t(t,(function(t,e,n,s){if("function"==typeof t&&void 0===t.cid){o=!0,i++;var u,c=Pt((function(e){var o;((o=e).__esModule||Tt&&"Module"===o[Symbol.toStringTag])&&(e=e.default),t.resolved="function"==typeof e?e:J.extend(e),n.components[s]=e,--i<=0&&r()})),l=Pt((function(t){var e="Failed to resolve async component "+s+": "+t;a||(a=Dt(t)?t:new Error(e),r(a))}));try{u=t(c,l)}catch(t){l(t)}if(u)if("function"==typeof u.then)u.then(c,l);else{var f=u.component;f&&"function"==typeof f.then&&f.then(c,l)}}})),o||r()}}function $t(t,e){return jt(t.map((function(t){return Object.keys(t.components).map((function(n){return e(t.components[n],t.instances[n],t,n)}))})))}function jt(t){return Array.prototype.concat.apply([],t)}var Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Pt(t){var e=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var Bt=function(t,e){this.router=t,this.base=function(t){if(!t)if(K){var e=document.querySelector("base");t=(t=e&&e.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else t="/";"/"!==t.charAt(0)&&(t="/"+t);return t.replace(/\/$/,"")}(e),this.current=y,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ft(t,e,n,r){var o=$t(t,(function(t,r,o,i){var a=function(t,e){"function"!=typeof t&&(t=J.extend(t));return t.options[e]}(t,e);if(a)return Array.isArray(a)?a.map((function(t){return n(t,r,o,i)})):n(a,r,o,i)}));return jt(r?o.reverse():o)}function It(t,e){if(e)return function(){return t.apply(e,arguments)}}Bt.prototype.listen=function(t){this.cb=t},Bt.prototype.onReady=function(t,e){this.ready?t():(this.readyCbs.push(t),e&&this.readyErrorCbs.push(e))},Bt.prototype.onError=function(t){this.errorCbs.push(t)},Bt.prototype.transitionTo=function(t,e,n){var r,o=this;try{r=this.router.match(t,this.current)}catch(t){throw this.errorCbs.forEach((function(e){e(t)})),t}var i=this.current;this.confirmTransition(r,(function(){o.updateRoute(r),e&&e(r),o.ensureURL(),o.router.afterHooks.forEach((function(t){t&&t(r,i)})),o.ready||(o.ready=!0,o.readyCbs.forEach((function(t){t(r)})))}),(function(t){n&&n(t),t&&!o.ready&&(Ot(t,_t.redirected)&&i===y||(o.ready=!0,o.readyErrorCbs.forEach((function(e){e(t)}))))}))},Bt.prototype.confirmTransition=function(t,e,n){var r=this,o=this.current;this.pending=t;var i=function(t){!Ot(t)&&Dt(t)&&(r.errorCbs.length?r.errorCbs.forEach((function(e){e(t)})):console.error(t)),n&&n(t)},a=t.matched.length-1,s=o.matched.length-1;if(x(t,o)&&a===s&&t.matched[a]===o.matched[s])return this.ensureURL(),i(function(t,e){var n=kt(t,e,_t.duplicated,'Avoided redundant navigation to current location: "'+t.fullPath+'".');return n.name="NavigationDuplicated",n}(o,t));var u=function(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n<r&&t[n]===e[n];n++);return{updated:e.slice(0,n),activated:e.slice(n),deactivated:t.slice(n)}}(this.current.matched,t.matched),c=u.updated,l=u.deactivated,f=u.activated,p=[].concat(function(t){return Ft(t,"beforeRouteLeave",It,!0)}(l),this.router.beforeHooks,function(t){return Ft(t,"beforeRouteUpdate",It)}(c),f.map((function(t){return t.beforeEnter})),St(f)),d=function(e,n){if(r.pending!==t)return i(At(o,t));try{e(t,o,(function(e){!1===e?(r.ensureURL(!0),i(function(t,e){return kt(t,e,_t.aborted,'Navigation aborted from "'+t.fullPath+'" to "'+e.fullPath+'" via a navigation guard.')}(o,t))):Dt(e)?(r.ensureURL(!0),i(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(i(Et(o,t)),"object"==typeof e&&e.replace?r.replace(e):r.push(e)):n(e)}))}catch(t){i(t)}};xt(p,d,(function(){xt(function(t){return Ft(t,"beforeRouteEnter",(function(t,e,n,r){return function(t,e,n){return function(r,o,i){return t(r,o,(function(t){"function"==typeof t&&(e.enteredCbs[n]||(e.enteredCbs[n]=[]),e.enteredCbs[n].push(t)),i(t)}))}}(t,n,r)}))}(f).concat(r.router.resolveHooks),d,(function(){if(r.pending!==t)return i(At(o,t));r.pending=null,e(t),r.router.app&&r.router.app.$nextTick((function(){E(t)}))}))}))},Bt.prototype.updateRoute=function(t){this.current=t,this.cb&&this.cb(t)},Bt.prototype.setupListeners=function(){},Bt.prototype.teardown=function(){this.listeners.forEach((function(t){t()})),this.listeners=[],this.current=y,this.pending=null};var Mt=function(t){function e(e,n){t.call(this,e,n),this._startLocation=Rt(this.base)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router,n=e.options.scrollBehavior,r=yt&&n;r&&this.listeners.push(ut());var o=function(){var n=t.current,o=Rt(t.base);t.current===y&&o===t._startLocation||t.transitionTo(o,(function(t){r&&ct(e,t,n,!0)}))};window.addEventListener("popstate",o),this.listeners.push((function(){window.removeEventListener("popstate",o)}))}},e.prototype.go=function(t){window.history.go(t)},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){bt(D(r.base+t.fullPath)),ct(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){wt(D(r.base+t.fullPath)),ct(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.ensureURL=function(t){if(Rt(this.base)!==this.current.fullPath){var e=D(this.base+this.current.fullPath);t?bt(e):wt(e)}},e.prototype.getCurrentLocation=function(){return Rt(this.base)},e}(Bt);function Rt(t){var e=window.location.pathname;return t&&0===e.toLowerCase().indexOf(t.toLowerCase())&&(e=e.slice(t.length)),(e||"/")+window.location.search+window.location.hash}var Lt=function(t){function e(e,n,r){t.call(this,e,n),r&&function(t){var e=Rt(t);if(!/^\/#/.test(e))return window.location.replace(D(t+"/#"+e)),!0}(this.base)||zt()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setupListeners=function(){var t=this;if(!(this.listeners.length>0)){var e=this.router.options.scrollBehavior,n=yt&&e;n&&this.listeners.push(ut());var r=function(){var e=t.current;zt()&&t.transitionTo(Nt(),(function(r){n&&ct(t.router,r,e,!0),yt||Ht(r.fullPath)}))},o=yt?"popstate":"hashchange";window.addEventListener(o,r),this.listeners.push((function(){window.removeEventListener(o,r)}))}},e.prototype.push=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){Vt(t.fullPath),ct(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this,o=this.current;this.transitionTo(t,(function(t){Ht(t.fullPath),ct(r.router,t,o,!1),e&&e(t)}),n)},e.prototype.go=function(t){window.history.go(t)},e.prototype.ensureURL=function(t){var e=this.current.fullPath;Nt()!==e&&(t?Vt(e):Ht(e))},e.prototype.getCurrentLocation=function(){return Nt()},e}(Bt);function zt(){var t=Nt();return"/"===t.charAt(0)||(Ht("/"+t),!1)}function Nt(){var t=window.location.href,e=t.indexOf("#");return e<0?"":t=t.slice(e+1)}function Ut(t){var e=window.location.href,n=e.indexOf("#");return(n>=0?e.slice(0,n):e)+"#"+t}function Vt(t){yt?bt(Ut(t)):window.location.hash=t}function Ht(t){yt?wt(Ut(t)):window.location.replace(Ut(t))}var qt=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)}),n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,(function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)}),n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var t=e.current;e.index=n,e.updateRoute(r),e.router.afterHooks.forEach((function(e){e&&e(r,t)}))}),(function(t){Ot(t,_t.duplicated)&&(e.index=n)}))}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(Bt),Wt=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=tt(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!yt&&!1!==t.fallback,this.fallback&&(e="hash"),K||(e="abstract"),this.mode=e,e){case"history":this.history=new Mt(this,t.base);break;case"hash":this.history=new Lt(this,t.base,this.fallback);break;case"abstract":this.history=new qt(this,t.base);break;default:0}},Jt={currentRoute:{configurable:!0}};function Gt(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}Wt.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},Jt.currentRoute.get=function(){return this.history&&this.history.current},Wt.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",(function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null),e.app||e.history.teardown()})),!this.app){this.app=t;var n=this.history;if(n instanceof Mt||n instanceof Lt){var r=function(t){n.setupListeners(),function(t){var r=n.current,o=e.options.scrollBehavior;yt&&o&&"fullPath"in t&&ct(e,t,r,!1)}(t)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(t){e.apps.forEach((function(e){e._route=t}))}))}},Wt.prototype.beforeEach=function(t){return Gt(this.beforeHooks,t)},Wt.prototype.beforeResolve=function(t){return Gt(this.resolveHooks,t)},Wt.prototype.afterEach=function(t){return Gt(this.afterHooks,t)},Wt.prototype.onReady=function(t,e){this.history.onReady(t,e)},Wt.prototype.onError=function(t){this.history.onError(t)},Wt.prototype.push=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.push(t,e,n)}));this.history.push(t,e,n)},Wt.prototype.replace=function(t,e,n){var r=this;if(!e&&!n&&"undefined"!=typeof Promise)return new Promise((function(e,n){r.history.replace(t,e,n)}));this.history.replace(t,e,n)},Wt.prototype.go=function(t){this.history.go(t)},Wt.prototype.back=function(){this.go(-1)},Wt.prototype.forward=function(){this.go(1)},Wt.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map((function(t){return Object.keys(t.components).map((function(e){return t.components[e]}))}))):[]},Wt.prototype.resolve=function(t,e,n){var r=W(t,e=e||this.history.current,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath;return{location:r,route:o,href:function(t,e,n){var r="hash"===n?"#"+e:e;return t?D(t+"/"+r):r}(this.history.base,i,this.mode),normalizedTo:r,resolved:o}},Wt.prototype.getRoutes=function(){return this.matcher.getRoutes()},Wt.prototype.addRoute=function(t,e){this.matcher.addRoute(t,e),this.history.current!==y&&this.history.transitionTo(this.history.getCurrentLocation())},Wt.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==y&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Wt.prototype,Jt),Wt.install=function t(e){if(!t.installed||J!==e){t.installed=!0,J=e;var n=function(t){return void 0!==t},r=function(t,e){var r=t.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(t,e)};e.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("RouterView",A),e.component("RouterLink",Q);var o=e.config.optionMergeStrategies;o.beforeRouteEnter=o.beforeRouteLeave=o.beforeRouteUpdate=o.created}},Wt.version="3.5.1",Wt.isNavigationFailure=Ot,Wt.NavigationFailureType=_t,Wt.START_LOCATION=y,K&&window.Vue&&window.Vue.use(Wt);var Qt=Wt;n(165),n(166),n(167),n(69),n(253),n(59),n(60),n(254);function Yt(t){t.locales&&Object.keys(t.locales).forEach((function(e){t.locales[e].path=e})),Object.freeze(t)}n(134);var Kt=n(50),Zt=(n(175),n(38),n(48),n(260),n(261),{NotFound:function(){return Promise.all([n.e(0),n.e(7)]).then(n.bind(null,547))},Category:function(){return Promise.all([n.e(0),n.e(1),n.e(6)]).then(n.bind(null,548))},Layout:function(){return Promise.all([n.e(0),n.e(1),n.e(3)]).then(n.bind(null,546))},Tag:function(){return Promise.all([n.e(0),n.e(1),n.e(4)]).then(n.bind(null,549))},Tags:function(){return Promise.all([n.e(0),n.e(1),n.e(5)]).then(n.bind(null,550))},TimeLines:function(){return Promise.all([n.e(0),n.e(1),n.e(9)]).then(n.bind(null,551))}}),Xt={"v-7be18cec":function(){return n.e(23).then(n.bind(null,552))},"v-eb0a8c32":function(){return n.e(16).then(n.bind(null,553))},"v-eb5372d0":function(){return n.e(17).then(n.bind(null,554))},"v-5c1fbe8d":function(){return n.e(18).then(n.bind(null,555))},"v-551a8cd8":function(){return n.e(14).then(n.bind(null,556))},"v-ff3b8a30":function(){return n.e(24).then(n.bind(null,557))},"v-17b76e9b":function(){return n.e(25).then(n.bind(null,558))},"v-0ab47119":function(){return n.e(19).then(n.bind(null,559))},"v-4783b3f0":function(){return n.e(15).then(n.bind(null,560))},"v-5cc1e664":function(){return n.e(26).then(n.bind(null,561))},"v-26b769fc":function(){return n.e(27).then(n.bind(null,562))},"v-76590885":function(){return n.e(12).then(n.bind(null,563))},"v-7684b546":function(){return n.e(20).then(n.bind(null,564))},"v-4eca38af":function(){return n.e(28).then(n.bind(null,565))},"v-0fd8cde4":function(){return n.e(29).then(n.bind(null,566))},"v-e830f74c":function(){return n.e(22).then(n.bind(null,567))},"v-82652b4c":function(){return n.e(21).then(n.bind(null,568))},"v-4bda0223":function(){return n.e(30).then(n.bind(null,569))},"v-380bd262":function(){return n.e(8).then(n.bind(null,570))},"v-a1de2e8a":function(){return n.e(31).then(n.bind(null,571))},"v-7ccfe036":function(){return n.e(10).then(n.bind(null,572))},"v-2a14a09e":function(){return n.e(32).then(n.bind(null,573))},"v-2bb1834f":function(){return n.e(34).then(n.bind(null,574))},"v-6e4dc3fa":function(){return n.e(33).then(n.bind(null,575))},"v-29e093d1":function(){return n.e(11).then(n.bind(null,576))},"v-25bbaa78":function(){return n.e(35).then(n.bind(null,577))}};function te(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}var ee=/-(\w)/g,ne=te((function(t){return t.replace(ee,(function(t,e){return e?e.toUpperCase():""}))})),re=/\B([A-Z])/g,oe=te((function(t){return t.replace(re,"-$1").toLowerCase()})),ie=te((function(t){return t.charAt(0).toUpperCase()+t.slice(1)}));function ae(t,e){if(e)return t(e)?t(e):e.includes("-")?t(ie(ne(e))):t(ie(e))||t(oe(e))}var se=Object.assign({},Zt,Xt),ue=function(t){return se[t]},ce=function(t){return Xt[t]},le=function(t){return Zt[t]},fe=function(t){return i.default.component(t)};function pe(t){return ae(ce,t)}function de(t){return ae(le,t)}function he(t){return ae(ue,t)}function ve(t){return ae(fe,t)}function me(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(e.filter((function(t){return t})).map(function(){var t=o(regeneratorRuntime.mark((function t(e){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(ve(e)||!he(e)){t.next=5;break}return t.next=3,he(e)();case 3:n=t.sent,i.default.component(e,n.default);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()))}function ge(t,e){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[t]=e)}n(84);n(45),n(61),n(83);var ye=n(91);function be(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t,e)||Object(ye.a)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n(176),n(131);var we=n(220),xe=n.n(we),_e={created:function(){if(this.siteMeta=this.$site.headTags.filter((function(t){return"meta"===be(t,1)[0]})).map((function(t){var e=be(t,2);e[0];return e[1]})),this.$ssrContext){var t=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(e=t)?e.map((function(t){var e="<meta";return Object.keys(t).forEach((function(n){e+=" ".concat(n,'="').concat(t[n],'"')})),e+">"})).join("\n "):"",this.$ssrContext.canonicalLink=Ae(this.$canonicalUrl)}var e},mounted:function(){this.currentMetaTags=Object(Kt.a)(document.querySelectorAll("meta")),this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta:function(){document.title=this.$title,document.documentElement.lang=this.$lang;var t=this.getMergedMetaTags();this.currentMetaTags=ke(t,this.currentMetaTags)},getMergedMetaTags:function(){var t=this.$page.frontmatter.meta||[];return xe()([{name:"description",content:this.$description}],t,this.siteMeta,Ce)},updateCanonicalLink:function(){Ee(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",Ae(this.$canonicalUrl))}},watch:{$page:function(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy:function(){ke(null,this.currentMetaTags),Ee()}};function Ee(){var t=document.querySelector("link[rel='canonical']");t&&t.remove()}function Ae(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t?'<link href="'.concat(t,'" rel="canonical" />'):""}function ke(t,e){if(e&&Object(Kt.a)(e).filter((function(t){return t.parentNode===document.head})).forEach((function(t){return document.head.removeChild(t)})),t)return t.map((function(t){var e=document.createElement("meta");return Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])})),document.head.appendChild(e),e}))}function Ce(t){for(var e=0,n=["name","property","itemprop"];e<n.length;e++){var r=n[e];if(t.hasOwnProperty(r))return t[r]+r}return JSON.stringify(t)}n(94);var De=n(221),Oe={mounted:function(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(De)()((function(){this.setActiveHash()}),300),setActiveHash:function(){for(var t=this,e=[].slice.call(document.querySelectorAll(".sidebar-link")),n=[].slice.call(document.querySelectorAll(".header-anchor")).filter((function(t){return e.some((function(e){return e.hash===t.hash}))})),r=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),o=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),i=window.innerHeight+r,a=0;a<n.length;a++){var s=n[a],u=n[a+1],c=0===a&&0===r||r>=s.parentElement.offsetTop+10&&(!u||r<u.parentElement.offsetTop-10),l=decodeURIComponent(this.$route.hash);if(c&&l!==decodeURIComponent(s.hash)){var f=s;if(i===o)for(var p=a+1;p<n.length;p++)if(l===decodeURIComponent(n[p].hash))return;return this.$vuepress.$set("disableScrollBehavior",!0),void this.$router.replace(decodeURIComponent(f.hash),(function(){t.$nextTick((function(){t.$vuepress.$set("disableScrollBehavior",!1)}))}))}}}},beforeDestroy:function(){window.removeEventListener("scroll",this.onScroll)}},Se=(n(67),n(357),Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}),$e=function(t){return"IMG"===t.tagName},je=function(t){return t&&1===t.nodeType},Te=function(t){return".svg"===(t.currentSrc||t.src).substr(-4).toLowerCase()},Pe=function(t){try{return Array.isArray(t)?t.filter($e):function(t){return NodeList.prototype.isPrototypeOf(t)}(t)?[].slice.call(t).filter($e):je(t)?[t].filter($e):"string"==typeof t?[].slice.call(document.querySelectorAll(t)).filter($e):[]}catch(t){throw new TypeError("The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList or an array.\nSee: https://github.com/francoischalifour/medium-zoom")}},Be=function(t){var e=document.createElement("div");return e.classList.add("medium-zoom-overlay"),e.style.background=t,e},Fe=function(t){var e=t.getBoundingClientRect(),n=e.top,r=e.left,o=e.width,i=e.height,a=t.cloneNode(),s=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,u=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return a.removeAttribute("id"),a.style.position="absolute",a.style.top=n+s+"px",a.style.left=r+u+"px",a.style.width=o+"px",a.style.height=i+"px",a.style.transform="",a},Ie=function(t,e){var n=Se({bubbles:!1,cancelable:!1,detail:void 0},e);if("function"==typeof window.CustomEvent)return new CustomEvent(t,n);var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail),r};!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}");var Me=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=window.Promise||function(t){function e(){}t(e,e)},o=function(t){var e=t.target;e!==k?-1!==b.indexOf(e)&&v({target:e}):h()},i=function(){if(!x&&A.original){var t=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(_-t)>E.scrollOffset&&setTimeout(h,150)}},a=function(t){var e=t.key||t.keyCode;"Escape"!==e&&"Esc"!==e&&27!==e||h()},s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t;if(t.background&&(k.style.background=t.background),t.container&&t.container instanceof Object&&(e.container=Se({},E.container,t.container)),t.template){var n=je(t.template)?t.template:document.querySelector(t.template);e.template=n}return E=Se({},E,e),b.forEach((function(t){t.dispatchEvent(Ie("medium-zoom:update",{detail:{zoom:C}}))})),C},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t(Se({},E,e))},c=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.reduce((function(t,e){return[].concat(t,Pe(e))}),[]);return r.filter((function(t){return-1===b.indexOf(t)})).forEach((function(t){b.push(t),t.classList.add("medium-zoom-image")})),w.forEach((function(t){var e=t.type,n=t.listener,o=t.options;r.forEach((function(t){t.addEventListener(e,n,o)}))})),C},l=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];A.zoomed&&h();var r=e.length>0?e.reduce((function(t,e){return[].concat(t,Pe(e))}),[]):b;return r.forEach((function(t){t.classList.remove("medium-zoom-image"),t.dispatchEvent(Ie("medium-zoom:detach",{detail:{zoom:C}}))})),b=b.filter((function(t){return-1===r.indexOf(t)})),C},f=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b.forEach((function(r){r.addEventListener("medium-zoom:"+t,e,n)})),w.push({type:"medium-zoom:"+t,listener:e,options:n}),C},p=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return b.forEach((function(r){r.removeEventListener("medium-zoom:"+t,e,n)})),w=w.filter((function(n){return!(n.type==="medium-zoom:"+t&&n.listener.toString()===e.toString())})),C},d=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=function(){var t={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},e=void 0,n=void 0;if(E.container)if(E.container instanceof Object)e=(t=Se({},t,E.container)).width-t.left-t.right-2*E.margin,n=t.height-t.top-t.bottom-2*E.margin;else{var r=(je(E.container)?E.container:document.querySelector(E.container)).getBoundingClientRect(),o=r.width,i=r.height,a=r.left,s=r.top;t=Se({},t,{width:o,height:i,left:a,top:s})}e=e||t.width-2*E.margin,n=n||t.height-2*E.margin;var u=A.zoomedHd||A.original,c=Te(u)?e:u.naturalWidth||e,l=Te(u)?n:u.naturalHeight||n,f=u.getBoundingClientRect(),p=f.top,d=f.left,h=f.width,v=f.height,m=Math.min(c,e)/h,g=Math.min(l,n)/v,y=Math.min(m,g),b="scale("+y+") translate3d("+((e-h)/2-d+E.margin+t.left)/y+"px, "+((n-v)/2-p+E.margin+t.top)/y+"px, 0)";A.zoomed.style.transform=b,A.zoomedHd&&(A.zoomedHd.style.transform=b)};return new r((function(t){if(e&&-1===b.indexOf(e))t(C);else{if(A.zoomed)t(C);else{if(e)A.original=e;else{if(!(b.length>0))return void t(C);var r=b;A.original=r[0]}if(A.original.dispatchEvent(Ie("medium-zoom:open",{detail:{zoom:C}})),_=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,x=!0,A.zoomed=Fe(A.original),document.body.appendChild(k),E.template){var o=je(E.template)?E.template:document.querySelector(E.template);A.template=document.createElement("div"),A.template.appendChild(o.content.cloneNode(!0)),document.body.appendChild(A.template)}if(document.body.appendChild(A.zoomed),window.requestAnimationFrame((function(){document.body.classList.add("medium-zoom--opened")})),A.original.classList.add("medium-zoom-image--hidden"),A.zoomed.classList.add("medium-zoom-image--opened"),A.zoomed.addEventListener("click",h),A.zoomed.addEventListener("transitionend",(function e(){x=!1,A.zoomed.removeEventListener("transitionend",e),A.original.dispatchEvent(Ie("medium-zoom:opened",{detail:{zoom:C}})),t(C)})),A.original.getAttribute("data-zoom-src")){A.zoomedHd=A.zoomed.cloneNode(),A.zoomedHd.removeAttribute("srcset"),A.zoomedHd.removeAttribute("sizes"),A.zoomedHd.src=A.zoomed.getAttribute("data-zoom-src"),A.zoomedHd.onerror=function(){clearInterval(i),console.warn("Unable to reach the zoom image target "+A.zoomedHd.src),A.zoomedHd=null,n()};var i=setInterval((function(){A.zoomedHd.complete&&(clearInterval(i),A.zoomedHd.classList.add("medium-zoom-image--opened"),A.zoomedHd.addEventListener("click",h),document.body.appendChild(A.zoomedHd),n())}),10)}else if(A.original.hasAttribute("srcset")){A.zoomedHd=A.zoomed.cloneNode(),A.zoomedHd.removeAttribute("sizes"),A.zoomedHd.removeAttribute("loading");var a=A.zoomedHd.addEventListener("load",(function(){A.zoomedHd.removeEventListener("load",a),A.zoomedHd.classList.add("medium-zoom-image--opened"),A.zoomedHd.addEventListener("click",h),document.body.appendChild(A.zoomedHd),n()}))}else n()}}}))},h=function(){return new r((function(t){if(!x&&A.original){x=!0,document.body.classList.remove("medium-zoom--opened"),A.zoomed.style.transform="",A.zoomedHd&&(A.zoomedHd.style.transform=""),A.template&&(A.template.style.transition="opacity 150ms",A.template.style.opacity=0),A.original.dispatchEvent(Ie("medium-zoom:close",{detail:{zoom:C}})),A.zoomed.addEventListener("transitionend",(function e(){A.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(A.zoomed),A.zoomedHd&&document.body.removeChild(A.zoomedHd),document.body.removeChild(k),A.zoomed.classList.remove("medium-zoom-image--opened"),A.template&&document.body.removeChild(A.template),x=!1,A.zoomed.removeEventListener("transitionend",e),A.original.dispatchEvent(Ie("medium-zoom:closed",{detail:{zoom:C}})),A.original=null,A.zoomed=null,A.zoomedHd=null,A.template=null,t(C)}))}else t(C)}))},v=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target;return A.original?h():d({target:e})},m=function(){return E},g=function(){return b},y=function(){return A.original},b=[],w=[],x=!1,_=0,E=n,A={original:null,zoomed:null,zoomedHd:null,template:null};"[object Object]"===Object.prototype.toString.call(e)?E=e:(e||"string"==typeof e)&&c(e),E=Se({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},E);var k=Be(E.background);document.addEventListener("click",o),document.addEventListener("keyup",a),document.addEventListener("scroll",i),window.addEventListener("resize",h);var C={open:d,close:h,toggle:v,update:s,clone:u,attach:c,detach:l,on:f,off:p,getOptions:m,getImages:g,getZoomedImage:y};return C},Re={data:function(){return{zoom:null}},mounted:function(){this.updateZoom()},updated:function(){this.updateZoom()},methods:{updateZoom:function(){var t=this;setTimeout((function(){t.zoom&&t.zoom.detach(),t.zoom=Me(".theme-reco-content :not(a) > img",void 0)}),1e3)}}},Le=(n(96),n(92)),ze=n.n(Le),Ne={mounted:function(){var t=this;ze.a.configure({showSpinner:!1}),this.$router.beforeEach((function(t,e,n){t.path===e.path||i.default.component(t.name)||ze.a.start(),n()})),this.$router.afterEach((function(){ze.a.done(),t.isSidebarOpen=!1}))}},Ue=n(222),Ve=n.n(Ue),He=(n(358),[_e,Oe,Re,Ne,{mounted:function(){Ve.a.polyfill()}}]),qe={name:"GlobalLayout",computed:{layout:function(){var t=this.getLayout();return ge("layout",t),i.default.component(t)}},methods:{getLayout:function(){if(this.$page.path){var t=this.$page.frontmatter.layout;return t&&(this.$vuepress.getLayoutAsyncComponent(t)||this.$vuepress.getVueComponent(t))?t:"Layout"}return"NotFound"}}},We=n(9),Je=Object(We.a)(qe,(function(){var t=this.$createElement;return(this._self._c||t)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(t,e,n){var r;switch(e){case"components":t[e]||(t[e]={}),Object.assign(t[e],n);break;case"mixins":t[e]||(t[e]=[]),(r=t[e]).push.apply(r,Object(Kt.a)(n));break;default:throw new Error("Unknown option name.")}}(Je,"mixins",He);var Ge=[{name:"v-7be18cec",path:"/Hooks/usePromiseReadyFn.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-7be18cec").then(n)}},{name:"v-eb0a8c32",path:"/Javascript/JavaScript%E6%95%B0%E7%BB%84%E7%9A%84%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95%E6%9C%89%E5%93%AA%E4%BA%9B.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-eb0a8c32").then(n)}},{path:"/Javascript/JavaScript数组的常用方法有哪些.html",redirect:"/Javascript/JavaScript%E6%95%B0%E7%BB%84%E7%9A%84%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95%E6%9C%89%E5%93%AA%E4%BA%9B.html"},{path:"/Javascript/JavaScript数组的常用方法有哪些.html",redirect:"/Javascript/JavaScript%E6%95%B0%E7%BB%84%E7%9A%84%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95%E6%9C%89%E5%93%AA%E4%BA%9B.html"},{name:"v-eb5372d0",path:"/Javascript/eventloop%E3%80%81%E5%AE%8F%E4%BB%BB%E5%8A%A1%E5%92%8C%E5%BE%AE%E4%BB%BB%E5%8A%A1.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-eb5372d0").then(n)}},{path:"/Javascript/eventloop、宏任务和微任务.html",redirect:"/Javascript/eventloop%E3%80%81%E5%AE%8F%E4%BB%BB%E5%8A%A1%E5%92%8C%E5%BE%AE%E4%BB%BB%E5%8A%A1.html"},{path:"/Javascript/eventloop、宏任务和微任务.html",redirect:"/Javascript/eventloop%E3%80%81%E5%AE%8F%E4%BB%BB%E5%8A%A1%E5%92%8C%E5%BE%AE%E4%BB%BB%E5%8A%A1.html"},{name:"v-5c1fbe8d",path:"/Javascript/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%88%A4%E6%96%AD.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-5c1fbe8d").then(n)}},{path:"/Javascript/数据类型的判断.html",redirect:"/Javascript/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%88%A4%E6%96%AD.html"},{path:"/Javascript/数据类型的判断.html",redirect:"/Javascript/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%88%A4%E6%96%AD.html"},{name:"v-551a8cd8",path:"/Javascript/%E4%B8%8A%E6%8B%89%E5%8A%A0%E8%BD%BD%E4%B8%8B%E6%8B%89%E5%88%B7%E6%96%B0.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-551a8cd8").then(n)}},{path:"/Javascript/上拉加载下拉刷新.html",redirect:"/Javascript/%E4%B8%8A%E6%8B%89%E5%8A%A0%E8%BD%BD%E4%B8%8B%E6%8B%89%E5%88%B7%E6%96%B0.html"},{path:"/Javascript/上拉加载下拉刷新.html",redirect:"/Javascript/%E4%B8%8A%E6%8B%89%E5%8A%A0%E8%BD%BD%E4%B8%8B%E6%8B%89%E5%88%B7%E6%96%B0.html"},{name:"v-ff3b8a30",path:"/Javascript/this%E6%8C%87%E5%90%91.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-ff3b8a30").then(n)}},{path:"/Javascript/this指向.html",redirect:"/Javascript/this%E6%8C%87%E5%90%91.html"},{path:"/Javascript/this指向.html",redirect:"/Javascript/this%E6%8C%87%E5%90%91.html"},{name:"v-17b76e9b",path:"/Javascript/%E6%B5%85%E6%8B%B7%E8%B4%9D%E5%92%8C%E6%B7%B1%E6%8B%B7%E8%B4%9D.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-17b76e9b").then(n)}},{path:"/Javascript/浅拷贝和深拷贝.html",redirect:"/Javascript/%E6%B5%85%E6%8B%B7%E8%B4%9D%E5%92%8C%E6%B7%B1%E6%8B%B7%E8%B4%9D.html"},{path:"/Javascript/浅拷贝和深拷贝.html",redirect:"/Javascript/%E6%B5%85%E6%8B%B7%E8%B4%9D%E5%92%8C%E6%B7%B1%E6%8B%B7%E8%B4%9D.html"},{name:"v-0ab47119",path:"/Javascript/%E9%98%B2%E6%8A%96%E5%92%8C%E8%8A%82%E6%B5%81.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-0ab47119").then(n)}},{path:"/Javascript/防抖和节流.html",redirect:"/Javascript/%E9%98%B2%E6%8A%96%E5%92%8C%E8%8A%82%E6%B5%81.html"},{path:"/Javascript/防抖和节流.html",redirect:"/Javascript/%E9%98%B2%E6%8A%96%E5%92%8C%E8%8A%82%E6%B5%81.html"},{name:"v-4783b3f0",path:"/Other/Ajax%E5%8E%9F%E7%90%86%E5%92%8C%E5%AE%9E%E7%8E%B0.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-4783b3f0").then(n)}},{path:"/Other/Ajax原理和实现.html",redirect:"/Other/Ajax%E5%8E%9F%E7%90%86%E5%92%8C%E5%AE%9E%E7%8E%B0.html"},{path:"/Other/Ajax原理和实现.html",redirect:"/Other/Ajax%E5%8E%9F%E7%90%86%E5%92%8C%E5%AE%9E%E7%8E%B0.html"},{name:"v-5cc1e664",path:"/Other/CentOS8%E9%85%8D%E7%BD%AENginx.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-5cc1e664").then(n)}},{path:"/Other/CentOS8配置Nginx.html",redirect:"/Other/CentOS8%E9%85%8D%E7%BD%AENginx.html"},{path:"/Other/CentOS8配置Nginx.html",redirect:"/Other/CentOS8%E9%85%8D%E7%BD%AENginx.html"},{name:"v-26b769fc",path:"/Other/Git%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-26b769fc").then(n)}},{path:"/Other/Git常用指令.html",redirect:"/Other/Git%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4.html"},{path:"/Other/Git常用指令.html",redirect:"/Other/Git%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4.html"},{name:"v-76590885",path:"/Other/HTTP%E5%92%8CHTTPS.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-76590885").then(n)}},{path:"/Other/HTTP和HTTPS.html",redirect:"/Other/HTTP%E5%92%8CHTTPS.html"},{path:"/Other/HTTP和HTTPS.html",redirect:"/Other/HTTP%E5%92%8CHTTPS.html"},{name:"v-7684b546",path:"/Other/HTTP%E5%B8%B8%E8%A7%81%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-7684b546").then(n)}},{path:"/Other/HTTP常见的状态码.html",redirect:"/Other/HTTP%E5%B8%B8%E8%A7%81%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81.html"},{path:"/Other/HTTP常见的状态码.html",redirect:"/Other/HTTP%E5%B8%B8%E8%A7%81%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81.html"},{name:"v-4eca38af",path:"/Other/",component:Je,beforeEnter:function(t,e,n){me("Layout","v-4eca38af").then(n)}},{path:"/Other/index.html",redirect:"/Other/"},{name:"v-0fd8cde4",path:"/Other/SEO%E4%BC%98%E5%8C%96%E9%87%8D%E8%A6%81%E7%9A%84%E5%85%83%E6%A0%87%E7%AD%BE.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-0fd8cde4").then(n)}},{path:"/Other/SEO优化重要的元标签.html",redirect:"/Other/SEO%E4%BC%98%E5%8C%96%E9%87%8D%E8%A6%81%E7%9A%84%E5%85%83%E6%A0%87%E7%AD%BE.html"},{path:"/Other/SEO优化重要的元标签.html",redirect:"/Other/SEO%E4%BC%98%E5%8C%96%E9%87%8D%E8%A6%81%E7%9A%84%E5%85%83%E6%A0%87%E7%AD%BE.html"},{name:"v-e830f74c",path:"/Other/SPA%E9%A6%96%E5%B1%8F%E5%8A%A0%E8%BD%BD%E9%80%9F%E5%BA%A6.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-e830f74c").then(n)}},{path:"/Other/SPA首屏加载速度.html",redirect:"/Other/SPA%E9%A6%96%E5%B1%8F%E5%8A%A0%E8%BD%BD%E9%80%9F%E5%BA%A6.html"},{path:"/Other/SPA首屏加载速度.html",redirect:"/Other/SPA%E9%A6%96%E5%B1%8F%E5%8A%A0%E8%BD%BD%E9%80%9F%E5%BA%A6.html"},{name:"v-82652b4c",path:"/Other/Markdown.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-82652b4c").then(n)}},{name:"v-4bda0223",path:"/Other/video%E9%BC%A0%E6%A0%87%E7%A7%BB%E5%8A%A8%E9%A2%84%E8%A7%88.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-4bda0223").then(n)}},{path:"/Other/video鼠标移动预览.html",redirect:"/Other/video%E9%BC%A0%E6%A0%87%E7%A7%BB%E5%8A%A8%E9%A2%84%E8%A7%88.html"},{path:"/Other/video鼠标移动预览.html",redirect:"/Other/video%E9%BC%A0%E6%A0%87%E7%A7%BB%E5%8A%A8%E9%A2%84%E8%A7%88.html"},{name:"v-380bd262",path:"/Other/%E5%9C%B0%E5%9D%80%E6%A0%8F%E8%BE%93%E5%85%A5URL%E6%95%B2%E4%B8%8B%E5%9B%9E%E8%BD%A6.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-380bd262").then(n)}},{path:"/Other/地址栏输入URL敲下回车.html",redirect:"/Other/%E5%9C%B0%E5%9D%80%E6%A0%8F%E8%BE%93%E5%85%A5URL%E6%95%B2%E4%B8%8B%E5%9B%9E%E8%BD%A6.html"},{path:"/Other/地址栏输入URL敲下回车.html",redirect:"/Other/%E5%9C%B0%E5%9D%80%E6%A0%8F%E8%BE%93%E5%85%A5URL%E6%95%B2%E4%B8%8B%E5%9B%9E%E8%BD%A6.html"},{name:"v-a1de2e8a",path:"/Other/%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%85%B3%E9%94%AE%E8%AF%8D%E9%AB%98%E4%BA%AE%E6%98%BE%E7%A4%BA.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-a1de2e8a").then(n)}},{path:"/Other/模糊搜索关键词高亮显示.html",redirect:"/Other/%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%85%B3%E9%94%AE%E8%AF%8D%E9%AB%98%E4%BA%AE%E6%98%BE%E7%A4%BA.html"},{path:"/Other/模糊搜索关键词高亮显示.html",redirect:"/Other/%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%85%B3%E9%94%AE%E8%AF%8D%E9%AB%98%E4%BA%AE%E6%98%BE%E7%A4%BA.html"},{name:"v-7ccfe036",path:"/Other/TCP%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E4%B8%89%E6%AC%A1%E6%8F%A1%E6%89%8B%E5%92%8C%E5%9B%9B%E6%AC%A1%E6%8C%A5%E6%89%8B.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-7ccfe036").then(n)}},{path:"/Other/TCP为什么需要三次握手和四次挥手.html",redirect:"/Other/TCP%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E4%B8%89%E6%AC%A1%E6%8F%A1%E6%89%8B%E5%92%8C%E5%9B%9B%E6%AC%A1%E6%8C%A5%E6%89%8B.html"},{path:"/Other/TCP为什么需要三次握手和四次挥手.html",redirect:"/Other/TCP%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E4%B8%89%E6%AC%A1%E6%8F%A1%E6%89%8B%E5%92%8C%E5%9B%9B%E6%AC%A1%E6%8C%A5%E6%89%8B.html"},{name:"v-2a14a09e",path:"/",component:Je,beforeEnter:function(t,e,n){me("Layout","v-2a14a09e").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-2bb1834f",path:"/Vue/Vue%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-2bb1834f").then(n)}},{path:"/Vue/Vue常见问题.html",redirect:"/Vue/Vue%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.html"},{path:"/Vue/Vue常见问题.html",redirect:"/Vue/Vue%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.html"},{name:"v-6e4dc3fa",path:"/Vue/",component:Je,beforeEnter:function(t,e,n){me("Layout","v-6e4dc3fa").then(n)}},{path:"/Vue/index.html",redirect:"/Vue/"},{name:"v-29e093d1",path:"/Vue/30%E9%81%93Vue%E9%9D%A2%E8%AF%95%E9%A2%98.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-29e093d1").then(n)}},{path:"/Vue/30道Vue面试题.html",redirect:"/Vue/30%E9%81%93Vue%E9%9D%A2%E8%AF%95%E9%A2%98.html"},{path:"/Vue/30道Vue面试题.html",redirect:"/Vue/30%E9%81%93Vue%E9%9D%A2%E8%AF%95%E9%A2%98.html"},{name:"v-25bbaa78",path:"/Vue/nextTick.html",component:Je,beforeEnter:function(t,e,n){me("Layout","v-25bbaa78").then(n)}},{name:"v-b1564aac",path:"/tag/",component:Je,beforeEnter:function(t,e,n){me("Tags","v-b1564aac").then(n)},meta:{pid:"tags",id:"tags"}},{path:"/tag/index.html",redirect:"/tag/"},{name:"v-ef9325c4",path:"/categories/",component:Je,beforeEnter:function(t,e,n){me("FrontmatterKey","v-ef9325c4").then(n)},meta:{pid:"categories",id:"categories"}},{path:"/categories/index.html",redirect:"/categories/"},{name:"v-6319eb4e",path:"/timeline/",component:Je,beforeEnter:function(t,e,n){me("TimeLines","v-6319eb4e").then(n)},meta:{pid:"timeline",id:"timeline"}},{path:"/timeline/index.html",redirect:"/timeline/"},{name:"v-ee4c346e",path:"/tag/Hooks/",component:Je,beforeEnter:function(t,e,n){me("Tag","v-ee4c346e").then(n)},meta:{pid:"tags",id:"Hooks"}},{path:"/tag/Hooks/index.html",redirect:"/tag/Hooks/"},{name:"v-7a5f6990",path:"/tag/JavaScript/",component:Je,beforeEnter:function(t,e,n){me("Tag","v-7a5f6990").then(n)},meta:{pid:"tags",id:"JavaScript"}},{path:"/tag/JavaScript/index.html",redirect:"/tag/JavaScript/"},{name:"v-d5e1fb2e",path:"/tag/Other/",component:Je,beforeEnter:function(t,e,n){me("Tag","v-d5e1fb2e").then(n)},meta:{pid:"tags",id:"Other"}},{path:"/tag/Other/index.html",redirect:"/tag/Other/"},{name:"v-322a45da",path:"/tag/vue/",component:Je,beforeEnter:function(t,e,n){me("Tag","v-322a45da").then(n)},meta:{pid:"tags",id:"vue"}},{path:"/tag/vue/index.html",redirect:"/tag/vue/"},{name:"v-79ce5d86",path:"/categories/Hooks/",component:Je,beforeEnter:function(t,e,n){me("Category","v-79ce5d86").then(n)},meta:{pid:"categories",id:"Hooks"}},{path:"/categories/Hooks/index.html",redirect:"/categories/Hooks/"},{name:"v-081e6844",path:"/categories/JavaScript/",component:Je,beforeEnter:function(t,e,n){me("Category","v-081e6844").then(n)},meta:{pid:"categories",id:"JavaScript"}},{path:"/categories/JavaScript/index.html",redirect:"/categories/JavaScript/"},{name:"v-61642446",path:"/categories/Other/",component:Je,beforeEnter:function(t,e,n){me("Category","v-61642446").then(n)},meta:{pid:"categories",id:"Other"}},{path:"/categories/Other/index.html",redirect:"/categories/Other/"},{name:"v-7f0789a7",path:"/categories/Vue/",component:Je,beforeEnter:function(t,e,n){me("Category","v-7f0789a7").then(n)},meta:{pid:"categories",id:"Vue"}},{path:"/categories/Vue/index.html",redirect:"/categories/Vue/"},{name:"v-cc3f8998",path:"/tag/Other/page/2/",component:Je,beforeEnter:function(t,e,n){me("Layout","v-cc3f8998").then(n)},meta:{pid:"tags",id:"Other"}},{path:"/tag/Other/page/2/index.html",redirect:"/tag/Other/page/2/"},{name:"v-77c97580",path:"/categories/Other/page/2/",component:Je,beforeEnter:function(t,e,n){me("Layout","v-77c97580").then(n)},meta:{pid:"categories",id:"Other"}},{path:"/categories/Other/page/2/index.html",redirect:"/categories/Other/page/2/"},{path:"*",component:Je}],Qe={title:"Zzongke",description:"zzk的Blog",base:"/blog/",headTags:[["link",{rel:"icon",href:"/blog/logo.jpg"}],["meta",{name:"viewport",content:"width=device-width,initial-scale=1,user-scalable=no"}],["meta",{name:"description",content:"zzongke的Blog,zZongke的Blog,Zzongke的Blog"}]],pages:[{title:"usePromiseReadyFn",frontmatter:{title:"usePromiseReadyFn",date:"2023-12-02T12:48:00.000Z",categories:["Hooks"],tags:["Hooks"]},regularPath:"/Hooks/usePromiseReadyFn.html",relativePath:"Hooks/usePromiseReadyFn.md",key:"v-7be18cec",path:"/Hooks/usePromiseReadyFn.html",lastUpdated:"12/2/2023, 1:01:38 PM"},{title:"JavaScript数组的常用方法有哪些",frontmatter:{title:"JavaScript数组的常用方法有哪些",date:"2022-03-29T17:12:00.000Z",categories:["JavaScript"],tags:["JavaScript"]},regularPath:"/Javascript/JavaScript%E6%95%B0%E7%BB%84%E7%9A%84%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95%E6%9C%89%E5%93%AA%E4%BA%9B.html",relativePath:"Javascript/JavaScript数组的常用方法有哪些.md",key:"v-eb0a8c32",path:"/Javascript/JavaScript%E6%95%B0%E7%BB%84%E7%9A%84%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95%E6%9C%89%E5%93%AA%E4%BA%9B.html",headers:[{level:2,title:"一、操作方法",slug:"一、操作方法"},{level:2,title:"二、排序方法",slug:"二、排序方法"},{level:2,title:"三、转换方法",slug:"三、转换方法"},{level:2,title:"四、迭代方法",slug:"四、迭代方法"}],lastUpdated:"3/29/2022, 6:54:57 PM"},{title:"event loop、宏任务和微任务",frontmatter:{title:"event loop、宏任务和微任务",date:"2022-05-24T10:38:00.000Z",categories:["JavaScript"],tags:["JavaScript"]},regularPath:"/Javascript/eventloop%E3%80%81%E5%AE%8F%E4%BB%BB%E5%8A%A1%E5%92%8C%E5%BE%AE%E4%BB%BB%E5%8A%A1.html",relativePath:"Javascript/eventloop、宏任务和微任务.md",key:"v-eb5372d0",path:"/Javascript/eventloop%E3%80%81%E5%AE%8F%E4%BB%BB%E5%8A%A1%E5%92%8C%E5%BE%AE%E4%BB%BB%E5%8A%A1.html",headers:[{level:2,title:"一、event loop、宏任务和微任务",slug:"一、event-loop、宏任务和微任务"},{level:2,title:"二、Promise",slug:"二、promise"},{level:2,title:"三、async/await 和 Promise 的关系",slug:"三、async-await-和-promise-的关系"}],lastUpdated:"6/17/2022, 11:36:25 PM"},{title:"数据类型的判断",frontmatter:{title:"数据类型的判断",date:"2022-05-23T13:42:00.000Z",categories:["JavaScript"],tags:["JavaScript"]},regularPath:"/Javascript/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%88%A4%E6%96%AD.html",relativePath:"Javascript/数据类型的判断.md",key:"v-5c1fbe8d",path:"/Javascript/%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%88%A4%E6%96%AD.html",headers:[{level:2,title:"一、基本数据类型",slug:"一、基本数据类型"},{level:3,title:"两大类型:",slug:"两大类型"},{level:2,title:"二、数据类型的判断",slug:"二、数据类型的判断"}],lastUpdated:"5/25/2022, 9:07:25 AM"},{title:"上拉加载下拉刷新",frontmatter:{title:"上拉加载下拉刷新",date:"2022-03-09T11:16:00.000Z",categories:["JavaScript"],tags:["JavaScript"]},regularPath:"/Javascript/%E4%B8%8A%E6%8B%89%E5%8A%A0%E8%BD%BD%E4%B8%8B%E6%8B%89%E5%88%B7%E6%96%B0.html",relativePath:"Javascript/上拉加载下拉刷新.md",key:"v-551a8cd8",path:"/Javascript/%E4%B8%8A%E6%8B%89%E5%8A%A0%E8%BD%BD%E4%B8%8B%E6%8B%89%E5%88%B7%E6%96%B0.html",headers:[{level:2,title:"一、前言",slug:"一、前言"},{level:2,title:"二、实现原理",slug:"二、实现原理"},{level:3,title:"上拉加载",slug:"上拉加载"},{level:3,title:"下拉刷新",slug:"下拉刷新"},{level:2,title:"三、案例",slug:"三、案例"},{level:3,title:"小结",slug:"小结"}],lastUpdated:"3/29/2022, 6:33:46 PM"},{title:"this指向",frontmatter:{title:"this指向",date:"2022-04-07T15:52:00.000Z",categories:["JavaScript"],tags:["JavaScript"]},regularPath:"/Javascript/this%E6%8C%87%E5%90%91.html",relativePath:"Javascript/this指向.md",key:"v-ff3b8a30",path:"/Javascript/this%E6%8C%87%E5%90%91.html",headers:[{level:2,title:"一、定义",slug:"一、定义"},{level:2,title:"二、绑定规则",slug:"二、绑定规则"},{level:3,title:"默认绑定",slug:"默认绑定"},{level:3,title:"隐式绑定",slug:"隐式绑定"},{level:3,title:"new 绑定",slug:"new-绑定"},{level:3,title:"显示修改",slug:"显示修改"},{level:2,title:"三、箭头函数",slug:"三、箭头函数"},{level:2,title:"四、优先级",slug:"四、优先级"},{level:3,title:"隐式绑定 VS 显式绑定",slug:"隐式绑定-vs-显式绑定"},{level:3,title:"new 绑定 VS 隐式绑定",slug:"new-绑定-vs-隐式绑定"},{level:2,title:"五、apply、call、bind 实现",slug:"五、apply、call、bind-实现"},{level:2,title:"6、new 实现",slug:"_6、new-实现"}],lastUpdated:"5/25/2022, 9:07:25 AM"},{title:"浅拷贝和深拷贝",frontmatter:{title:"浅拷贝和深拷贝",date:"2022-03-01T14:55:00.000Z",categories:["JavaScript"],tags:["JavaScript"]},regularPath:"/Javascript/%E6%B5%85%E6%8B%B7%E8%B4%9D%E5%92%8C%E6%B7%B1%E6%8B%B7%E8%B4%9D.html",relativePath:"Javascript/浅拷贝和深拷贝.md",key:"v-17b76e9b",path:"/Javascript/%E6%B5%85%E6%8B%B7%E8%B4%9D%E5%92%8C%E6%B7%B1%E6%8B%B7%E8%B4%9D.html",lastUpdated:"5/25/2022, 9:07:25 AM"},{title:"函数防抖和节流",frontmatter:{title:"函数防抖和节流",date:"2022-03-01T14:55:00.000Z",categories:["JavaScript"],tags:["JavaScript"]},regularPath:"/Javascript/%E9%98%B2%E6%8A%96%E5%92%8C%E8%8A%82%E6%B5%81.html",relativePath:"Javascript/防抖和节流.md",key:"v-0ab47119",path:"/Javascript/%E9%98%B2%E6%8A%96%E5%92%8C%E8%8A%82%E6%B5%81.html",headers:[{level:2,title:"防抖(debounce)",slug:"防抖-debounce"},{level:3,title:"概念",slug:"概念"},{level:3,title:"应用场景",slug:"应用场景"},{level:3,title:"简易版",slug:"简易版"},{level:3,title:"函数版",slug:"函数版"},{level:2,title:"节流(throttle)",slug:"节流-throttle"},{level:3,title:"概念",slug:"概念-2"},{level:3,title:"应用场景",slug:"应用场景-2"},{level:3,title:"简易版",slug:"简易版-2"},{level:3,title:"定时器版本",slug:"定时器版本"},{level:3,title:"时间戳版本",slug:"时间戳版本"},{level:3,title:"定时器+时间戳版本",slug:"定时器-时间戳版本"},{level:2,title:"react-hook 防抖和节流",slug:"react-hook-防抖和节流"}],lastUpdated:"3/29/2022, 6:33:46 PM"},{title:"Ajax原理和实现",frontmatter:{title:"Ajax原理和实现",date:"2022-03-08T15:43:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/Ajax%E5%8E%9F%E7%90%86%E5%92%8C%E5%AE%9E%E7%8E%B0.html",relativePath:"Other/Ajax原理和实现.md",key:"v-4783b3f0",path:"/Other/Ajax%E5%8E%9F%E7%90%86%E5%92%8C%E5%AE%9E%E7%8E%B0.html",headers:[{level:2,title:"一、Ajax 是什么?",slug:"一、ajax-是什么"},{level:2,title:"二、实现过程",slug:"二、实现过程"},{level:3,title:"创建 XMLHttpRequest 对象",slug:"创建-xmlhttprequest-对象"},{level:3,title:"与服务器建立连接",slug:"与服务器建立连接"},{level:3,title:"给服务端发送数据",slug:"给服务端发送数据"},{level:3,title:"绑定onreadystatechange事件",slug:"绑定onreadystatechange事件"},{level:2,title:"三、封装",slug:"三、封装"}],lastUpdated:"3/16/2022, 6:38:11 PM"},{title:"CentOS8配置Nginx",frontmatter:{title:"CentOS8配置Nginx",date:"2022-03-01T14:55:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/CentOS8%E9%85%8D%E7%BD%AENginx.html",relativePath:"Other/CentOS8配置Nginx.md",key:"v-5cc1e664",path:"/Other/CentOS8%E9%85%8D%E7%BD%AENginx.html",headers:[{level:2,title:"1.连接到 Linux CentOS8 的服务器",slug:"_1-连接到-linux-centos8-的服务器"},{level:2,title:"2.安装编译器",slug:"_2-安装编译器"},{level:2,title:"3.建立存放的文件夹",slug:"_3-建立存放的文件夹"},{level:2,title:"4.移动到文件夹",slug:"_4-移动到文件夹"},{level:2,title:"5.下载 nginx",slug:"_5-下载-nginx"},{level:2,title:"6.解压 nginx.tar.gz",slug:"_6-解压-nginx-tar-gz"},{level:2,title:"7.移动到解压的文件夹",slug:"_7-移动到解压的文件夹"},{level:2,title:"8.配置文件",slug:"_8-配置文件"},{level:2,title:"9.编译和安装",slug:"_9-编译和安装"},{level:2,title:"10.查找安装路径和移动到文件夹",slug:"_10-查找安装路径和移动到文件夹"},{level:2,title:"11.启动 nginx",slug:"_11-启动-nginx"},{level:2,title:"12.重新加载配置",slug:"_12-重新加载配置"}],lastUpdated:"3/5/2022, 4:30:55 PM"},{title:"Git常用指令",frontmatter:{title:"Git常用指令",date:"2022-03-01T15:15:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/Git%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4.html",relativePath:"Other/Git常用指令.md",key:"v-26b769fc",path:"/Other/Git%E5%B8%B8%E7%94%A8%E6%8C%87%E4%BB%A4.html",headers:[{level:2,title:"项目初始化",slug:"项目初始化"},{level:2,title:"项目关联",slug:"项目关联"},{level:3,title:"克隆项目",slug:"克隆项目"},{level:3,title:"本地项目关联远程仓库",slug:"本地项目关联远程仓库"},{level:2,title:"分支操作",slug:"分支操作"},{level:3,title:"查看分支",slug:"查看分支"},{level:3,title:"切换分支",slug:"切换分支"},{level:3,title:"拉去分支",slug:"拉去分支"},{level:3,title:"删除分支",slug:"删除分支"},{level:3,title:"创建本地新分支并推送到远程",slug:"创建本地新分支并推送到远程"},{level:3,title:"暂存",slug:"暂存"},{level:2,title:"提交操作",slug:"提交操作"},{level:3,title:"代码提交",slug:"代码提交"},{level:3,title:"提交历史",slug:"提交历史"},{level:3,title:"本地代码回滚",slug:"本地代码回滚"},{level:3,title:"标签功能",slug:"标签功能"},{level:2,title:"配置",slug:"配置"},{level:3,title:"config 配置",slug:"config-配置"}],lastUpdated:"3/5/2022, 4:30:55 PM"},{title:"HTTP和HTTPS的区别",frontmatter:{title:"HTTP和HTTPS的区别",date:"2022-03-05T11:29:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/HTTP%E5%92%8CHTTPS.html",relativePath:"Other/HTTP和HTTPS.md",key:"v-76590885",path:"/Other/HTTP%E5%92%8CHTTPS.html",headers:[{level:2,title:"一、HTTP",slug:"一、http"},{level:2,title:"二、HTTPS",slug:"二、https"},{level:2,title:"三、区别",slug:"三、区别"}],lastUpdated:"3/5/2022, 4:30:55 PM"},{title:"HTTP 常见的状态码",frontmatter:{title:"HTTP 常见的状态码",date:"2022-03-05T15:18:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/HTTP%E5%B8%B8%E8%A7%81%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81.html",relativePath:"Other/HTTP常见的状态码.md",key:"v-7684b546",path:"/Other/HTTP%E5%B8%B8%E8%A7%81%E7%9A%84%E7%8A%B6%E6%80%81%E7%A0%81.html",headers:[{level:2,title:"一、是什么",slug:"一、是什么"},{level:2,title:"二、分类",slug:"二、分类"},{level:3,title:"1xx",slug:"_1xx"},{level:3,title:"2xx",slug:"_2xx"},{level:3,title:"3xx",slug:"_3xx"},{level:3,title:"4xx",slug:"_4xx"},{level:3,title:"5xx",slug:"_5xx"},{level:2,title:"三、适用场景",slug:"三、适用场景"}],lastUpdated:"6/14/2022, 4:00:06 PM"},{title:"其它",frontmatter:{title:"其它",date:"2022-02-15T16:09:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/",relativePath:"Other/README.md",key:"v-4eca38af",path:"/Other/",lastUpdated:"3/1/2022, 3:25:54 PM"},{title:"SEO优化重要的元标签",frontmatter:{title:"SEO优化重要的元标签",date:"2022-06-26T11:19:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/SEO%E4%BC%98%E5%8C%96%E9%87%8D%E8%A6%81%E7%9A%84%E5%85%83%E6%A0%87%E7%AD%BE.html",relativePath:"Other/SEO优化重要的元标签.md",key:"v-0fd8cde4",path:"/Other/SEO%E4%BC%98%E5%8C%96%E9%87%8D%E8%A6%81%E7%9A%84%E5%85%83%E6%A0%87%E7%AD%BE.html",headers:[{level:2,title:"1.Title标签",slug:"_1-title标签"},{level:2,title:"2.Meta Description标签",slug:"_2-meta-description标签"},{level:2,title:"3.标题标签(h1-h6)",slug:"_3-标题标签-h1-h6"},{level:2,title:"4.图片Alt属性",slug:"_4-图片alt属性"},{level:2,title:"5.Robots Meta标签",slug:"_5-robots-meta标签"},{level:2,title:"6.Canonical标签",slug:"_6-canonical标签"},{level:2,title:"7.社交媒体 Meta 标签",slug:"_7-社交媒体-meta-标签"},{level:3,title:"一、Facebook Open Graph",slug:"一、facebook-open-graph"},{level:3,title:"二、Twitter Card",slug:"二、twitter-card"},{level:2,title:"8. 响应式设计 viewport Meta 标签",slug:"_8-响应式设计-viewport-meta-标签"}],lastUpdated:"6/26/2022, 12:24:49 PM"},{title:"SPA(单页应用)首屏加载速度",frontmatter:{title:"SPA(单页应用)首屏加载速度",date:"2022-03-03T15:57:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/SPA%E9%A6%96%E5%B1%8F%E5%8A%A0%E8%BD%BD%E9%80%9F%E5%BA%A6.html",relativePath:"Other/SPA首屏加载速度.md",key:"v-e830f74c",path:"/Other/SPA%E9%A6%96%E5%B1%8F%E5%8A%A0%E8%BD%BD%E9%80%9F%E5%BA%A6.html",headers:[{level:2,title:"一、什么是首屏加载",slug:"一、什么是首屏加载"},{level:2,title:"二、加载慢的原因",slug:"二、加载慢的原因"},{level:2,title:"三、解决方案",slug:"三、解决方案"},{level:3,title:"减少入口文件体积",slug:"减少入口文件体积"},{level:3,title:"静态资源本地缓存",slug:"静态资源本地缓存"},{level:3,title:"UI 框架按需加载",slug:"ui-框架按需加载"},{level:3,title:"图片资源的压缩",slug:"图片资源的压缩"},{level:3,title:"开启 Gzip 压缩",slug:"开启-gzip-压缩"},{level:3,title:"使用 SSR",slug:"使用-ssr"},{level:3,title:"小结",slug:"小结"}],lastUpdated:"3/5/2022, 4:30:55 PM"},{title:"Markdown 语法指南",frontmatter:{title:"Markdown 语法指南",date:"2022-03-01T14:55:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/Markdown.html",relativePath:"Other/Markdown.md",key:"v-82652b4c",path:"/Other/Markdown.html",headers:[{level:2,title:"标题",slug:"标题"},{level:2,title:"二级标题",slug:"二级标题"},{level:3,title:"三级标题",slug:"三级标题"},{level:2,title:"二级标题",slug:"二级标题-2"},{level:2,title:"字体",slug:"字体"},{level:2,title:"线条",slug:"线条"},{level:2,title:"这是一条分割线",slug:"这是一条分割线"},{level:2,title:"列表",slug:"列表"},{level:3,title:"无序列表",slug:"无序列表"},{level:3,title:"有序列表",slug:"有序列表"},{level:3,title:"列表嵌套",slug:"列表嵌套"},{level:3,title:"任务列表",slug:"任务列表"},{level:3,title:"引用",slug:"引用"},{level:3,title:"链接",slug:"链接"},{level:3,title:"图片",slug:"图片"},{level:2,title:"表格",slug:"表格"},{level:2,title:"代码",slug:"代码"},{level:3,title:"单行代码",slug:"单行代码"},{level:2,title:"流程图",slug:"流程图"},{level:2,title:"兼容 HTML",slug:"兼容-html"},{level:2,title:"注解",slug:"注解"}],lastUpdated:"3/5/2022, 4:30:55 PM"},{title:"video鼠标移动预览",frontmatter:{title:"video鼠标移动预览",date:"2022-05-12T11:22:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/video%E9%BC%A0%E6%A0%87%E7%A7%BB%E5%8A%A8%E9%A2%84%E8%A7%88.html",relativePath:"Other/video鼠标移动预览.md",key:"v-4bda0223",path:"/Other/video%E9%BC%A0%E6%A0%87%E7%A7%BB%E5%8A%A8%E9%A2%84%E8%A7%88.html",headers:[{level:2,title:"video 鼠标移动预览",slug:"video-鼠标移动预览"},{level:2,title:"代码",slug:"代码"}],lastUpdated:"5/12/2022, 1:06:42 PM"},{title:"地址栏输入 URL 敲下回车",frontmatter:{title:"地址栏输入 URL 敲下回车",date:"2022-03-05T15:43:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/%E5%9C%B0%E5%9D%80%E6%A0%8F%E8%BE%93%E5%85%A5URL%E6%95%B2%E4%B8%8B%E5%9B%9E%E8%BD%A6.html",relativePath:"Other/地址栏输入URL敲下回车.md",key:"v-380bd262",path:"/Other/%E5%9C%B0%E5%9D%80%E6%A0%8F%E8%BE%93%E5%85%A5URL%E6%95%B2%E4%B8%8B%E5%9B%9E%E8%BD%A6.html",headers:[{level:2,title:"一、简单分析",slug:"一、简单分析"},{level:2,title:"二、详细分析",slug:"二、详细分析"},{level:3,title:"URL 解析",slug:"url-解析"},{level:3,title:"DNS 查询",slug:"dns-查询"},{level:3,title:"TCP 连接",slug:"tcp-连接"},{level:3,title:"发送 http 请求",slug:"发送-http-请求"},{level:3,title:"响应请求",slug:"响应请求"},{level:3,title:"页面渲染",slug:"页面渲染"}],lastUpdated:"6/14/2022, 4:00:06 PM"},{title:"模糊搜索关键词高亮显示",frontmatter:{title:"模糊搜索关键词高亮显示",date:"2022-03-01T14:23:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%85%B3%E9%94%AE%E8%AF%8D%E9%AB%98%E4%BA%AE%E6%98%BE%E7%A4%BA.html",relativePath:"Other/模糊搜索关键词高亮显示.md",key:"v-a1de2e8a",path:"/Other/%E6%A8%A1%E7%B3%8A%E6%90%9C%E7%B4%A2%E5%85%B3%E9%94%AE%E8%AF%8D%E9%AB%98%E4%BA%AE%E6%98%BE%E7%A4%BA.html",lastUpdated:"3/5/2022, 4:30:55 PM"},{title:"TCP为什么需要三次握手和四次挥手",frontmatter:{title:"TCP为什么需要三次握手和四次挥手",date:"2022-03-05T16:08:00.000Z",categories:["Other"],tags:["Other"]},regularPath:"/Other/TCP%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E4%B8%89%E6%AC%A1%E6%8F%A1%E6%89%8B%E5%92%8C%E5%9B%9B%E6%AC%A1%E6%8C%A5%E6%89%8B.html",relativePath:"Other/TCP为什么需要三次握手和四次挥手.md",key:"v-7ccfe036",path:"/Other/TCP%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E4%B8%89%E6%AC%A1%E6%8F%A1%E6%89%8B%E5%92%8C%E5%9B%9B%E6%AC%A1%E6%8C%A5%E6%89%8B.html",headers:[{level:2,title:"一、三次握手",slug:"一、三次握手"},{level:3,title:"为什么不是两次握手?",slug:"为什么不是两次握手"},{level:2,title:"二、四次挥手",slug:"二、四次挥手"},{level:2,title:"总结",slug:"总结"}],lastUpdated:"3/5/2022, 4:30:55 PM"},{title:"Home",frontmatter:{home:!0,heroImage:"./logo.jpg",heroText:"Normal No More!",tagline:"zzk的Blog",heroImageStyle:{width:"200px",height:"200px",display:"block",margin:"6rem auto 1.5rem",borderRadius:"50%",boxShadow:"0 5px 18px rgba(0,0,0,0.2)"}},regularPath:"/",relativePath:"README.md",key:"v-2a14a09e",path:"/",lastUpdated:"3/16/2022, 6:38:11 PM"},{title:"Vue常见问题",frontmatter:{title:"Vue常见问题",date:"2022-02-15T00:00:00.000Z",categories:["Vue"],tags:["vue"]},regularPath:"/Vue/Vue%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.html",relativePath:"Vue/Vue常见问题.md",key:"v-2bb1834f",path:"/Vue/Vue%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.html",lastUpdated:"2/15/2022, 11:51:09 AM"},{frontmatter:{},regularPath:"/Vue/",relativePath:"Vue/README.md",key:"v-6e4dc3fa",path:"/Vue/",lastUpdated:"5/26/2021, 2:37:50 PM"},{title:"30 道 Vue 面试题",frontmatter:{title:"30 道 Vue 面试题",date:"2022-03-15T14:55:00.000Z",categories:["Vue"],tags:["vue"]},regularPath:"/Vue/30%E9%81%93Vue%E9%9D%A2%E8%AF%95%E9%A2%98.html",relativePath:"Vue/30道Vue面试题.md",key:"v-29e093d1",path:"/Vue/30%E9%81%93Vue%E9%9D%A2%E8%AF%95%E9%A2%98.html",headers:[{level:2,title:"1、说说你对 SPA 单页面的理解,它的优缺点分别是什么?",slug:"_1、说说你对-spa-单页面的理解-它的优缺点分别是什么"},{level:2,title:"2、v-show 与 v-if 有什么区别?",slug:"_2、v-show-与-v-if-有什么区别"},{level:2,title:"3、Class 与 Style 如何动态绑定?",slug:"_3、class-与-style-如何动态绑定"},{level:2,title:"4、怎样理解 Vue 的单向数据流?",slug:"_4、怎样理解-vue-的单向数据流"},{level:2,title:"5、computed 和 watch 的区别和运用的场景?",slug:"_5、computed-和-watch-的区别和运用的场景"},{level:2,title:"6、直接给一个数组赋值,Vue 能监测到变化吗?",slug:"_6、直接给一个数组赋值-vue-能监测到变化吗"},{level:2,title:"7、谈谈你对 Vue 生命周期的理解?",slug:"_7、谈谈你对-vue-生命周期的理解"},{level:3,title:"(1)生命周期是什么?",slug:"_1-生命周期是什么"},{level:3,title:"(2)各个生命周期的作用?",slug:"_2-各个生命周期的作用"},{level:3,title:"(3)生命周期示意图",slug:"_3-生命周期示意图"},{level:2,title:"8、Vue 的父组件和子组件生命周期钩子函数执行顺序?",slug:"_8、vue-的父组件和子组件生命周期钩子函数执行顺序"},{level:2,title:"9、在哪个生命周期内调用异步请求?",slug:"_9、在哪个生命周期内调用异步请求"},{level:2,title:"10、在什么阶段才能访问操作 DOM?",slug:"_10、在什么阶段才能访问操作-dom"},{level:2,title:"11、父组件可以监听到子组件的生命周期吗?",slug:"_11、父组件可以监听到子组件的生命周期吗"},{level:2,title:"12、谈谈你对 keep-alive 的了解?",slug:"_12、谈谈你对-keep-alive-的了解"},{level:2,title:"13、组件中 data 为什么是一个函数?",slug:"_13、组件中-data-为什么是一个函数"},{level:2,title:"14、v-model 的原理?",slug:"_14、v-model-的原理"},{level:2,title:"15、Vue 组件间通信有哪几种方式?",slug:"_15、vue-组件间通信有哪几种方式"},{level:3,title:"(1)props / $emit 适用 父子组件通信",slug:"_1-props-emit-适用-父子组件通信"},{level:3,title:"(2)ref 与 $parent / $children 适用 父子组件通信",slug:"_2-ref-与-parent-children-适用-父子组件通信"},{level:3,title:"(3)EventBus ($emit / $on) 适用于 父子、隔代、兄弟组件通信",slug:"_3-eventbus-emit-on-适用于-父子、隔代、兄弟组件通信"},{level:3,title:"(4)$attrs/$listeners 适用于 隔代组件通信",slug:"_4-attrs-listeners-适用于-隔代组件通信"},{level:3,title:"(5)provide / inject 适用于 隔代组件通信",slug:"_5-provide-inject-适用于-隔代组件通信"},{level:3,title:"(6)Vuex 适用于 父子、隔代、兄弟组件通信",slug:"_6-vuex-适用于-父子、隔代、兄弟组件通信"},{level:2,title:"16、你使用过 Vuex 吗?",slug:"_16、你使用过-vuex-吗"},{level:2,title:"17、使用过 Vue SSR 吗?说说 SSR?",slug:"_17、使用过-vue-ssr-吗-说说-ssr"},{level:2,title:"18、vue-router 路由模式有几种?",slug:"_18、vue-router-路由模式有几种"},{level:2,title:"19、能说下 vue-router 中常用的 hash 和 history 路由模式实现原理吗?",slug:"_19、能说下-vue-router-中常用的-hash-和-history-路由模式实现原理吗"},{level:3,title:"(1)hash 模式的实现原理",slug:"_1-hash-模式的实现原理"},{level:3,title:"(2)history 模式的实现原理",slug:"_2-history-模式的实现原理"},{level:2,title:"20、什么是 MVVM?",slug:"_20、什么是-mvvm"},{level:3,title:"(1)View 层",slug:"_1-view-层"},{level:3,title:"(2)Model 层",slug:"_2-model-层"},{level:3,title:"(3)ViewModel 层",slug:"_3-viewmodel-层"},{level:2,title:"21、Vue 是如何实现数据双向绑定的?",slug:"_21、vue-是如何实现数据双向绑定的"},{level:3,title:"22、Vue 框架怎么实现对象和数组的监听?",slug:"_22、vue-框架怎么实现对象和数组的监听"},{level:3,title:"23、Proxy 与 Object.defineProperty 优劣对比",slug:"_23、proxy-与-object-defineproperty-优劣对比"},{level:2,title:"24、Vue 怎么用 vm.\\$set() 解决对象新增属性不能响应的问题 ?",slug:"_24、vue-怎么用-vm-set-解决对象新增属性不能响应的问题"},{level:2,title:"25、虚拟 DOM 的优缺点?",slug:"_25、虚拟-dom-的优缺点"},{level:2,title:"26、虚拟 DOM 实现原理?",slug:"_26、虚拟-dom-实现原理"},{level:2,title:"27、Vue 中的 key 有什么作用?",slug:"_27、vue-中的-key-有什么作用"},{level:2,title:"28、你有对 Vue 项目进行哪些优化?",slug:"_28、你有对-vue-项目进行哪些优化"},{level:3,title:"(1)代码层面的优化",slug:"_1-代码层面的优化"},{level:3,title:"(2)Webpack 层面的优化",slug:"_2-webpack-层面的优化"},{level:3,title:"(3)基础的 Web 技术的优化",slug:"_3-基础的-web-技术的优化"},{level:2,title:"29、对于即将到来的 vue3.0 特性你有什么了解的吗?",slug:"_29、对于即将到来的-vue3-0-特性你有什么了解的吗"},{level:3,title:"(1)监测机制的改变",slug:"_1-监测机制的改变"},{level:3,title:"(2)模板",slug:"_2-模板"},{level:3,title:"(3)对象式的组件声明方式",slug:"_3-对象式的组件声明方式"},{level:3,title:"(4)其它方面的更改",slug:"_4-其它方面的更改"},{level:2,title:"30、手写 Promise.all 和 Promise.race",slug:"_30、手写-promise-all-和-promise-race"},{level:3,title:"Promise.all()",slug:"promise-all"},{level:3,title:"Promise.race()",slug:"promise-race"}],lastUpdated:"6/14/2022, 4:00:06 PM"},{title:"Vue的nextTick源码解析",frontmatter:{title:"Vue的nextTick源码解析",date:"2022-02-15T16:09:00.000Z",categories:["Vue"],tags:["vue"]},regularPath:"/Vue/nextTick.html",relativePath:"Vue/nextTick.md",key:"v-25bbaa78",path:"/Vue/nextTick.html",lastUpdated:"3/16/2022, 6:38:11 PM"},{frontmatter:{layout:"Tags",title:"Tags"},regularPath:"/tag/",key:"v-b1564aac",path:"/tag/"},{frontmatter:{layout:"FrontmatterKey",title:"Categories"},regularPath:"/categories/",key:"v-ef9325c4",path:"/categories/"},{frontmatter:{layout:"TimeLines",title:"Timeline"},regularPath:"/timeline/",key:"v-6319eb4e",path:"/timeline/"},{frontmatter:{layout:"Tag",title:"Hooks Tags"},regularPath:"/tag/Hooks/",key:"v-ee4c346e",path:"/tag/Hooks/"},{frontmatter:{layout:"Tag",title:"JavaScript Tags"},regularPath:"/tag/JavaScript/",key:"v-7a5f6990",path:"/tag/JavaScript/"},{frontmatter:{layout:"Tag",title:"Other Tags"},regularPath:"/tag/Other/",key:"v-d5e1fb2e",path:"/tag/Other/"},{frontmatter:{layout:"Tag",title:"vue Tags"},regularPath:"/tag/vue/",key:"v-322a45da",path:"/tag/vue/"},{frontmatter:{layout:"Category",title:"Hooks Categories"},regularPath:"/categories/Hooks/",key:"v-79ce5d86",path:"/categories/Hooks/"},{frontmatter:{layout:"Category",title:"JavaScript Categories"},regularPath:"/categories/JavaScript/",key:"v-081e6844",path:"/categories/JavaScript/"},{frontmatter:{layout:"Category",title:"Other Categories"},regularPath:"/categories/Other/",key:"v-61642446",path:"/categories/Other/"},{frontmatter:{layout:"Category",title:"Vue Categories"},regularPath:"/categories/Vue/",key:"v-7f0789a7",path:"/categories/Vue/"},{frontmatter:{layout:"Layout",title:"Page 2 - Other | Tags"},regularPath:"/tag/Other/page/2/",key:"v-cc3f8998",path:"/tag/Other/page/2/"},{frontmatter:{layout:"Layout",title:"Page 2 - Other | Categories"},regularPath:"/categories/Other/page/2/",key:"v-77c97580",path:"/categories/Other/page/2/"}],themeConfig:{type:"blog",author:"Zzongke",authorAvatar:"/logo.jpg",title:"Normal No More",lastUpdated:"Last Updated",blogConfig:{category:{location:1,text:"Category"},tag:{location:2,text:"tag"},socialLinks:[{icon:"reco-github",link:"https://github.com/recoluan"},{icon:"reco-npm",link:"https://www.npmjs.com/~reco_luan"}]},nav:[{text:"Home",link:"/",icon:"reco-home"},{text:"TimeLine",link:"/timeline/",icon:"reco-date"},{icon:"reco-github",text:"JavaScript",link:"/JavaScript/"},{text:"Web",items:[{text:"React",link:"https://zh-hans.reactjs.org/"},{text:"React",link:"https://zh-hans.reactjs.org/"}]},{text:"Nginx",link:"https://www.nginx.cn/doc/"},{text:"Node",link:"https://nodejs.org/api/"}],subSidebar:"auto",sidebar:{"/JavaScript/":["/JavaScript/数据类型的判断","/JavaScript/防抖和节流","/JavaScript/上拉加载下拉刷新","/JavaScript/浅拷贝和深拷贝","/JavaScript/JavaScript数组的常用方法有哪些","/JavaScript/this指向","/JavaScript/eventloop、宏任务和微任务"],"/Vue/":["/Vue/Vue常见问题","/Vue/nextTick","30道Vue面试题"],"/Other/":["/Other/Git常用指令","/Other/Markdown","/Other/模糊搜索关键词高亮显示","/Other/CentOS8配置Nginx","/Other/SPA首屏加载速度","/Other/HTTP和HTTPS","/Other/HTTP常见的状态码","/Other/地址栏输入URL敲下回车","/Other/TCP为什么需要三次握手和四次挥手","/Other/Ajax原理和实现","/Other/video鼠标移动预览","/Other/SEO优化重要的元标签"],Hooks:["/Hooks/usePromiseReadyFn"]},friendLink:[{title:"vuepress-theme-reco",desc:"A simple and beautiful vuepress Blog & Doc theme.",logo:"https://vuepress-theme-reco.recoluan.com/icon_vuepress_reco.png",link:"https://vuepress-theme-reco.recoluan.com"},{title:"午后南杂",desc:"Enjoy when you can, and endure when you must.",email:"recoluan@qq.com",link:"https://www.recoluan.com"}],noFoundPageByTencent:!1,record:"ICP 备案文案",recordLink:"ICP 备案指向链接",cyberSecurityRecord:"公安部备案文案",cyberSecurityLink:"公安部备案指向链接",startYear:"2021",codeTheme:"tomorrow"}},Ye=(n(49),n(228),n(229),n(68),n(230),n(64)),Ke={computed:{$recoPosts:function(){var t=this.$site.pages;return t=Object(Ye.a)(t,!1),Object(Ye.c)(t),t},$recoPostsForTimeline:function(){var t=this.$recoPosts,e={},n=[];t=Object(Ye.a)(t,!0),this.pages=0==t.length?[]:t;for(var r=0,o=t.length;r<o;r++){var i=t[r],a=Ze(i.frontmatter.date,"year");e[a]?e[a].push(i):e[a]=[i]}for(var s in e){var u=e[s];Object(Ye.b)(u),n.unshift({year:s,data:u})}return n},$categoriesList:function(){return this.$categories.list.map((function(t){return t.pages=t.pages.filter((function(t){return!1!==t.frontmatter.publish})),t}))},$tagesList:function(){return this.$tags.list.map((function(t){return t.pages=t.pages.filter((function(t){return!1!==t.frontmatter.publish})),t}))},$showSubSideBar:function(){var t=this.$themeConfig,e=t.subSidebar,n=t.sidebar,r=this.$frontmatter,o=r.subSidebar,i=r.sidebar,a=this.$page.headers||[];return!([o,i].indexOf(!1)>-1)&&([o,i].indexOf("auto")>-1&&a.length>0||[e,n].indexOf("auto")>-1&&a.length>0)}}};function Ze(t,e){t=function(t){var e=new Date(t).toJSON();return new Date(+new Date(e)+288e5).toISOString().replace(/T/g," ").replace(/\.[\d]{3}Z/,"").replace(/-/g,"/")}(t);var n=new Date(t),r=n.getFullYear(),o=n.getMonth()+1,i=n.getDate();return"year"==e?r:"".concat(o,"-").concat(i)}var Xe=n(6),tn={all:"全部",article:"文章",tag:"标签",category:"分类",friendLink:"友情链接",timeLine:"时间轴",timeLineMsg:"昨日重现!"},en={all:"全部",article:"文章",tag:"標簽",category:"分類",friendLink:"友情鏈接",timeLine:"時間軸",timeLineMsg:"昨日重現!"},nn={all:"All",article:"Articles",tag:"Tags",category:"Categories",friendLink:"Friend Links",timeLine:"TimeLine",timeLineMsg:"Yesterday Once More!"},rn={all:"全部",article:"文章",tag:"ラベル",category:"分類",friendLink:"友情リンク",timeLine:"タイムライン",timeLineMsg:"昨日また!"},on={all:"전체",article:"글",tag:"태그",category:"분류",friendLink:"링크 참조",timeLine:"타임 라인",timeLineMsg:"어제 또!"},an={all:"Todas",article:"Artículos",tag:"Etiquetas",category:"Categorías",friendLink:"Páginas amigas",timeLine:"Cronología",timeLineMsg:"¡Ayer otra vez!"},sn={computed:{$recoLocales:function(){var t=this.$themeLocaleConfig.recoLocales||{};return/^zh\-(CN|SG)$/.test(this.$lang)?Object(Xe.a)(Object(Xe.a)({},tn),t):/^zh\-(HK|MO|TW)$/.test(this.$lang)?Object(Xe.a)(Object(Xe.a)({},en),t):/^ja\-JP$/.test(this.$lang)?Object(Xe.a)(Object(Xe.a)({},rn),t):/^ko\-KR$/.test(this.$lang)?Object(Xe.a)(Object(Xe.a)({},on),t):/^es(\-[A-Z]+)?$/.test(this.$lang)?Object(Xe.a)(Object(Xe.a)({},an),t):Object(Xe.a)(Object(Xe.a)({},nn),t)}}},un=n(93),cn=n(130);n(365);i.default.component("Badge",(function(){return Promise.all([n.e(0),n.e(13)]).then(n.bind(null,578))}));n(366);var ln={name:"BackToTop",data:function(){return{visible:!1,customStyle:{right:"1rem",bottom:"6rem",width:"2.5rem",height:"2.5rem","border-radius":".25rem","line-height":"2.5rem"},visibilityHeight:400}},mounted:function(){window.addEventListener("scroll",this.throttle(this.handleScroll,500))},beforeDestroy:function(){window.removeEventListener("scroll",this.throttle(this.handleScroll,500))},methods:{handleScroll:function(){this.visible=window.pageYOffset>this.visibilityHeight},backToTop:function(){window.scrollTo(0,0)},throttle:function(t,e){var n=null,r=Date.now();return function(){var o=Date.now(),i=e-(o-r),a=this,s=arguments;clearTimeout(n),i<=0?(t.apply(a,s),r=Date.now()):n=setTimeout(t,i)}}}},fn=(n(367),Object(We.a)(ln,(function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"fade"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:this.visible,expression:"visible"}],staticClass:"back-to-ceiling",style:this.customStyle,on:{click:this.backToTop}},[e("svg",{staticClass:"icon",attrs:{t:"1574745035067",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5404"}},[e("path",{attrs:{d:"M526.60727968 10.90185116a27.675 27.675 0 0 0-29.21455937 0c-131.36607665 82.28402758-218.69155461 228.01873535-218.69155402 394.07834331a462.20625001 462.20625001 0 0 0 5.36959153 69.94390903c1.00431239 6.55289093-0.34802892 13.13561351-3.76865779 18.80351572-32.63518765 54.11355614-51.75690182 118.55860487-51.7569018 187.94566865a371.06718723 371.06718723 0 0 0 11.50484808 91.98906777c6.53300375 25.50556257 41.68394495 28.14064038 52.69160883 4.22606766 17.37162448-37.73630017 42.14135425-72.50938081 72.80769204-103.21549295 2.18761121 3.04276886 4.15646224 6.24463696 6.40373557 9.22774369a1871.4375 1871.4375 0 0 0 140.04691725 5.34970492 1866.36093723 1866.36093723 0 0 0 140.04691723-5.34970492c2.24727335-2.98310674 4.21612437-6.18497483 6.3937923-9.2178004 30.66633723 30.70611158 55.4360664 65.4791928 72.80769147 103.21549355 11.00766384 23.91457269 46.15860503 21.27949489 52.69160879-4.22606768a371.15156223 371.15156223 0 0 0 11.514792-91.99901164c0-69.36717486-19.13165746-133.82216804-51.75690182-187.92578088-3.42062944-5.66790279-4.76302748-12.26056868-3.76865837-18.80351632a462.20625001 462.20625001 0 0 0 5.36959269-69.943909c-0.00994388-166.08943902-87.32547796-311.81420293-218.6915546-394.09823051zM605.93803103 357.87693858a93.93749974 93.93749974 0 1 1-187.89594924 6.1e-7 93.93749974 93.93749974 0 0 1 187.89594924-6.1e-7z","p-id":"5405"}}),e("path",{attrs:{d:"M429.50777625 765.63860547C429.50777625 803.39355007 466.44236686 1000.39046097 512.00932183 1000.39046097c45.56695499 0 82.4922232-197.00623328 82.5015456-234.7518555 0-37.75494459-36.9345906-68.35043303-82.4922232-68.34111062-45.57627738-0.00932239-82.52019037 30.59548842-82.51086798 68.34111062z","p-id":"5406"}})])])])}),[],!1,null,"c6073ba8",null).exports),pn=(n(368),n(226),{prev:"上一页",next:"下一页",go:"前往",jump:"跳转至"}),dn={prev:"上壹頁",next:"下壹頁",go:"前往",jump:"跳轉至"},hn={prev:"Prev",next:"Next",go:"Go",jump:"Jump To"},vn={prev:"前のページ",next:"次のページ",go:"へ",jump:"ジャンプ"},mn={prev:"이전 페이지",next:"다음 페이지",go:"행",jump:"건너뛰기"};var gn={data:function(){return{changePage:"",pageSize:10}},props:{total:{type:Number,default:10},perPage:{type:Number,default:10},currentPage:{type:Number,default:1}},computed:{pages:function(){var t=this.pageSize||this.perPage;return Math.ceil(this.total/t)},show:function(){return this.pages&&1!=this.pages},efont:function(){return!(this.pages<=7)&&this.currentPage>5},indexs:function(){var t=1,e=this.pages,n=[];for(this.pages>=7&&(this.currentPage>5&&this.currentPage<this.pages-4?(t=Number(this.currentPage)-3,e=Number(this.currentPage)+3):this.currentPage<=5?(t=1,e=7):(e=this.pages,t=this.pages-6));t<=e;)n.push(t),t++;return n},pagationLocales:function(){return e=(t=this).$lang,n=t.$recoLocales,(n=void 0===n?{}:n).pagation||(/^zh\-(CN|SG)$/.test(e)?pn:/^zh\-(HK|MO|TW)$/.test(e)?dn:/^ja\-JP$/.test(e)?vn:/^ko\-KR$/.test(e)?mn:hn);var t,e,n}},methods:{goPrev:function(){var t=this.currentPage;this.currentPage>1&&this.emit(--t)},goNext:function(){var t=this.currentPage;t<this.pages&&this.emit(++t)},jumpPage:function(t){var e=parseInt(t);e<=this.pages&&e>0?this.emit(e):alert("请输入大于0,并且小于".concat(this.pages,"的页码!"))},emit:function(t){this.$emit("getCurrentPage",t)}}},yn=(n(370),Object(We.a)(gn,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"pagation"},[n("div",{staticClass:"pagation-list"},[n("span",{directives:[{name:"show",rawName:"v-show",value:t.currentPage>1,expression:"currentPage > 1"}],staticClass:"jump",attrs:{unselectable:"on"},on:{click:t.goPrev}},[t._v(t._s(t.pagationLocales.prev))]),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.efont,expression:"efont"}],staticClass:"jump",on:{click:function(e){return t.jumpPage(1)}}},[t._v("1")]),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.efont,expression:"efont"}],staticClass:"ellipsis"},[t._v("...")]),t._v(" "),t._l(t.indexs,(function(e){return n("span",{key:e,staticClass:"jump",class:{bgprimary:t.currentPage==e},on:{click:function(n){return t.jumpPage(e)}}},[t._v(t._s(e))])})),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.efont&&t.currentPage<t.pages-4,expression:"efont&¤tPage<pages-4"}],staticClass:"ellipsis"},[t._v("...")]),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.efont&&t.currentPage<t.pages-4,expression:"efont&¤tPage<pages-4"}],staticClass:"jump",on:{click:function(e){return t.jumpPage(t.pages)}}},[t._v(t._s(t.pages))]),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.currentPage<t.pages,expression:"currentPage < pages"}],staticClass:"jump",on:{click:t.goNext}},[t._v(t._s(t.pagationLocales.next))]),t._v(" "),n("span",{staticClass:"jumppoint"},[t._v(t._s(t.pagationLocales.jump))]),t._v(" "),n("span",{staticClass:"jumpinp"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.changePage,expression:"changePage"}],attrs:{type:"text"},domProps:{value:t.changePage},on:{input:function(e){e.target.composing||(t.changePage=e.target.value)}}})]),t._v(" "),n("span",{staticClass:"jump gobtn",on:{click:function(e){return t.jumpPage(t.changePage)}}},[t._v(t._s(t.pagationLocales.go))])],2)])}),[],!1,null,"094d08e4",null).exports),bn={name:"Valine",props:{options:{type:Object,default:function(){return{}}}},mounted:function(){this.initValine()},methods:{initValine:function(){new(n(371))(Object(Xe.a)({el:"#valine",placeholder:"just go go",notify:!1,verify:!1,avatar:"retro",visitor:!0,recordIP:!1,path:window.location.pathname},this.options))}},watch:{$route:function(t,e){var n=this;t.path!==e.path&&setTimeout((function(){n.initValine()}),300)}}},wn=(n(372),Object(We.a)(bn,(function(){var t=this.$createElement;this._self._c;return this._m(0)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"valine-wrapper"},[e("div",{attrs:{id:"valine"}})])}],!1,null,null,null).exports),xn=n(16);function _n(t){return Object(xn.a)((function(e,n){void 0===e.inject&&(e.inject={}),Array.isArray(e.inject)||(e.inject[n]=t||n)}))}function En(t){var e=function(){var n=this,r="function"==typeof t?t.call(this):t;for(var o in(r=Object.create(r||null)).__reactiveInject__=this.__reactiveInject__||{},e.managed)r[e.managed[o]]=this[o];var i=function(t){r[e.managedReactive[t]]=a[t],Object.defineProperty(r.__reactiveInject__,e.managedReactive[t],{enumerable:!0,get:function(){return n[t]}})},a=this;for(var o in e.managedReactive)i(o);return r};return e.managed={},e.managedReactive={},e}function An(t){return"function"!=typeof t||!t.managed&&!t.managedReactive}var kn="undefined"!=typeof Reflect&&void 0!==Reflect.getMetadata;function Cn(t,e,n){if(kn&&!Array.isArray(t)&&"function"!=typeof t&&void 0===t.type){var r=Reflect.getMetadata("design:type",e,n);r!==Object&&(t.type=r)}}function Dn(t){return void 0===t&&(t={}),function(e,n){Cn(t,e,n),Object(xn.a)((function(e,n){(e.props||(e.props={}))[n]=t}))(e,n)}}function On(t,e){void 0===e&&(e={});var n=e.deep,r=void 0!==n&&n,o=e.immediate,i=void 0!==o&&o;return Object(xn.a)((function(e,n){"object"!=typeof e.watch&&(e.watch=Object.create(null));var o=e.watch;"object"!=typeof o[t]||Array.isArray(o[t])?void 0===o[t]&&(o[t]=[]):o[t]=[o[t]],o[t].push({handler:n,deep:r,immediate:i})}))}var Sn=n(47);const $n=t=>Object(Sn.stringify)(t),jn=(t,e)=>`${t}${Object(Sn.stringify)(e,{addQueryPrefix:!0})}`,Tn=(t,e)=>`${t.replace(/\/$/,"")}/${e.replace(/^\//,"")}`;var Pn=n(223),Bn=n.n(Pn);const Fn=t=>Bn()(t,"YYYY-MM-DD HH:mm:ss"),In=t=>(t.split("#")[0]||"").split("?")[0]||"",Mn=t=>Object(Sn.parse)(t,{ignoreQueryPrefix:!0}) +/*! + * vue-i18n v8.27.0 + * (c) 2022 kazuya kawaguchi + * Released under the MIT License. + */;var Rn=["compactDisplay","currency","currencyDisplay","currencySign","localeMatcher","notation","numberingSystem","signDisplay","style","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function Ln(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}var zn=Array.isArray;function Nn(t){return null!==t&&"object"==typeof t}function Un(t){return"string"==typeof t}var Vn=Object.prototype.toString;function Hn(t){return"[object Object]"===Vn.call(t)}function qn(t){return null==t}function Wn(t){return"function"==typeof t}function Jn(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=null,r=null;return 1===t.length?Nn(t[0])||zn(t[0])?r=t[0]:"string"==typeof t[0]&&(n=t[0]):2===t.length&&("string"==typeof t[0]&&(n=t[0]),(Nn(t[1])||zn(t[1]))&&(r=t[1])),{locale:n,params:r}}function Gn(t){return JSON.parse(JSON.stringify(t))}function Qn(t,e){return!!~t.indexOf(e)}var Yn=Object.prototype.hasOwnProperty;function Kn(t,e){return Yn.call(t,e)}function Zn(t){for(var e=arguments,n=Object(t),r=1;r<arguments.length;r++){var o=e[r];if(null!=o){var i=void 0;for(i in o)Kn(o,i)&&(Nn(o[i])?n[i]=Zn(n[i],o[i]):n[i]=o[i])}}return n}function Xn(t,e){if(t===e)return!0;var n=Nn(t),r=Nn(e);if(!n||!r)return!n&&!r&&String(t)===String(e);try{var o=zn(t),i=zn(e);if(o&&i)return t.length===e.length&&t.every((function(t,n){return Xn(t,e[n])}));if(o||i)return!1;var a=Object.keys(t),s=Object.keys(e);return a.length===s.length&&a.every((function(n){return Xn(t[n],e[n])}))}catch(t){return!1}}function tr(t){return null!=t&&Object.keys(t).forEach((function(e){"string"==typeof t[e]&&(t[e]=t[e].replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"))})),t}var er={name:"i18n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var n=e.data,r=e.parent,o=e.props,i=e.slots,a=r.$i18n;if(a){var s=o.path,u=o.locale,c=o.places,l=i(),f=a.i(s,u,function(t){var e;for(e in t)if("default"!==e)return!1;return Boolean(e)}(l)||c?function(t,e){var n=e?function(t){0;return Array.isArray(t)?t.reduce(rr,{}):Object.assign({},t)}(e):{};if(!t)return n;var r=(t=t.filter((function(t){return t.tag||""!==t.text.trim()}))).every(or);0;return t.reduce(r?nr:rr,n)}(l.default,c):l),p=o.tag&&!0!==o.tag||!1===o.tag?o.tag:"span";return p?t(p,n,f):f}}};function nr(t,e){return e.data&&e.data.attrs&&e.data.attrs.place&&(t[e.data.attrs.place]=e),t}function rr(t,e,n){return t[n]=e,t}function or(t){return Boolean(t.data&&t.data.attrs&&t.data.attrs.place)}var ir,ar={name:"i18n-n",functional:!0,props:{tag:{type:[String,Boolean,Object],default:"span"},value:{type:Number,required:!0},format:{type:[String,Object]},locale:{type:String}},render:function(t,e){var n=e.props,r=e.parent,o=e.data,i=r.$i18n;if(!i)return null;var a=null,s=null;Un(n.format)?a=n.format:Nn(n.format)&&(n.format.key&&(a=n.format.key),s=Object.keys(n.format).reduce((function(t,e){var r;return Qn(Rn,e)?Object.assign({},t,((r={})[e]=n.format[e],r)):t}),null));var u=n.locale||i.locale,c=i._ntp(n.value,u,a,s),l=c.map((function(t,e){var n,r=o.scopedSlots&&o.scopedSlots[t.type];return r?r(((n={})[t.type]=t.value,n.index=e,n.parts=c,n)):t.value})),f=n.tag&&!0!==n.tag||!1===n.tag?n.tag:"span";return f?t(f,{attrs:o.attrs,class:o.class,staticClass:o.staticClass},l):l}};function sr(t,e,n){lr(t,n)&&fr(t,e,n)}function ur(t,e,n,r){if(lr(t,n)){var o=n.context.$i18n;(function(t,e){var n=e.context;return t._locale===n.$i18n.locale})(t,n)&&Xn(e.value,e.oldValue)&&Xn(t._localeMessage,o.getLocaleMessage(o.locale))||fr(t,e,n)}}function cr(t,e,n,r){if(n.context){var o=n.context.$i18n||{};e.modifiers.preserve||o.preserveDirectiveContent||(t.textContent=""),t._vt=void 0,delete t._vt,t._locale=void 0,delete t._locale,t._localeMessage=void 0,delete t._localeMessage}else Ln("Vue instance does not exists in VNode context")}function lr(t,e){var n=e.context;return n?!!n.$i18n||(Ln("VueI18n instance does not exists in Vue instance"),!1):(Ln("Vue instance does not exists in VNode context"),!1)}function fr(t,e,n){var r,o,i=function(t){var e,n,r,o;Un(t)?e=t:Hn(t)&&(e=t.path,n=t.locale,r=t.args,o=t.choice);return{path:e,locale:n,args:r,choice:o}}(e.value),a=i.path,s=i.locale,u=i.args,c=i.choice;if(a||s||u)if(a){var l=n.context;t._vt=t.textContent=null!=c?(r=l.$i18n).tc.apply(r,[a,c].concat(pr(s,u))):(o=l.$i18n).t.apply(o,[a].concat(pr(s,u))),t._locale=l.$i18n.locale,t._localeMessage=l.$i18n.getLocaleMessage(l.$i18n.locale)}else Ln("`path` is required in v-t directive");else Ln("value type not supported")}function pr(t,e){var n=[];return t&&n.push(t),e&&(Array.isArray(e)||Hn(e))&&n.push(e),n}function dr(t,e){void 0===e&&(e={bridge:!1}),dr.installed=!0;var n;(ir=t).version&&Number(ir.version.split(".")[0]);(n=ir).prototype.hasOwnProperty("$i18n")||Object.defineProperty(n.prototype,"$i18n",{get:function(){return this._i18n}}),n.prototype.$t=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},n.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var o=this.$i18n;return o._tc.apply(o,[t,o.locale,o._getMessages(),this,e].concat(n))},n.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},n.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},n.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))},ir.mixin(function(t){function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return void 0===t&&(t=!1),t?{mounted:e}:{beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n)if(t.i18n instanceof Sr){if(t.__i18nBridge||t.__i18n)try{var e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach((function(t){e=Zn(e,JSON.parse(t))})),Object.keys(e).forEach((function(n){t.i18n.mergeLocaleMessage(n,e[n])}))}catch(t){0}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(Hn(t.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Sr?this.$root.$i18n:null;if(n&&(t.i18n.root=this.$root,t.i18n.formatter=n.formatter,t.i18n.fallbackLocale=n.fallbackLocale,t.i18n.formatFallbackMessages=n.formatFallbackMessages,t.i18n.silentTranslationWarn=n.silentTranslationWarn,t.i18n.silentFallbackWarn=n.silentFallbackWarn,t.i18n.pluralizationRules=n.pluralizationRules,t.i18n.preserveDirectiveContent=n.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{var r=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach((function(t){r=Zn(r,JSON.parse(t))})),t.i18n.messages=r}catch(t){0}var o=t.i18n.sharedMessages;o&&Hn(o)&&(t.i18n.messages=Zn(t.i18n.messages,o)),this._i18n=new Sr(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}else 0;else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Sr?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Sr&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n?(t.i18n instanceof Sr||Hn(t.i18n))&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Sr||t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Sr)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick((function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)}))}}}}(e.bridge)),ir.directive("t",{bind:sr,update:ur,unbind:cr}),ir.component(er.name,er),ir.component(ar.name,ar),ir.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var hr=function(){this._caches=Object.create(null)};hr.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=function(t){var e=[],n=0,r="";for(;n<t.length;){var o=t[n++];if("{"===o){r&&e.push({type:"text",value:r}),r="";var i="";for(o=t[n++];void 0!==o&&"}"!==o;)i+=o,o=t[n++];var a="}"===o,s=vr.test(i)?"list":a&&mr.test(i)?"named":"unknown";e.push({value:i,type:s})}else"%"===o?"{"!==t[n]&&(r+=o):r+=o}return r&&e.push({type:"text",value:r}),e}(t),this._caches[t]=n),function(t,e){var n=[],r=0,o=Array.isArray(e)?"list":Nn(e)?"named":"unknown";if("unknown"===o)return n;for(;r<t.length;){var i=t[r];switch(i.type){case"text":n.push(i.value);break;case"list":n.push(e[parseInt(i.value,10)]);break;case"named":"named"===o&&n.push(e[i.value]);break;case"unknown":0}r++}return n}(n,e)};var vr=/^(?:\d)+/,mr=/^(?:\w)+/;var gr=[];gr[0]={ws:[0],ident:[3,0],"[":[4],eof:[7]},gr[1]={ws:[1],".":[2],"[":[4],eof:[7]},gr[2]={ws:[2],ident:[3,0],0:[3,0],number:[3,0]},gr[3]={ident:[3,0],0:[3,0],number:[3,0],ws:[1,1],".":[2,1],"[":[4,1],eof:[7,1]},gr[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],eof:8,else:[4,0]},gr[5]={"'":[4,0],eof:8,else:[5,0]},gr[6]={'"':[4,0],eof:8,else:[6,0]};var yr=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function br(t){if(null==t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function wr(t){var e,n,r,o=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(r=o,yr.test(r)?(n=(e=o).charCodeAt(0))!==e.charCodeAt(e.length-1)||34!==n&&39!==n?e:e.slice(1,-1):"*"+o)}var xr=function(){this._cache=Object.create(null)};xr.prototype.parsePath=function(t){var e=this._cache[t];return e||(e=function(t){var e,n,r,o,i,a,s,u=[],c=-1,l=0,f=0,p=[];function d(){var e=t[c+1];if(5===l&&"'"===e||6===l&&'"'===e)return c++,r="\\"+e,p[0](),!0}for(p[1]=function(){void 0!==n&&(u.push(n),n=void 0)},p[0]=function(){void 0===n?n=r:n+=r},p[2]=function(){p[0](),f++},p[3]=function(){if(f>0)f--,l=4,p[0]();else{if(f=0,void 0===n)return!1;if(!1===(n=wr(n)))return!1;p[1]()}};null!==l;)if(c++,"\\"!==(e=t[c])||!d()){if(o=br(e),8===(i=(s=gr[l])[o]||s.else||8))return;if(l=i[0],(a=p[i[1]])&&(r=void 0===(r=i[2])?e:r,!1===a()))return;if(7===l)return u}}(t))&&(this._cache[t]=e),e||[]},xr.prototype.getPathValue=function(t,e){if(!Nn(t))return null;var n=this.parsePath(e);if(0===n.length)return null;for(var r=n.length,o=t,i=0;i<r;){var a=o[n[i]];if(null==a)return null;o=a,i++}return o};var _r,Er=/<\/?[\w\s="/.':;#-\/]+>/,Ar=/(?:@(?:\.[a-z]+)?:(?:[\w\-_|./]+|\([\w\-_|./]+\)))/g,kr=/^@(?:\.([a-z]+))?:/,Cr=/[()]/g,Dr={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},Or=new hr,Sr=function(t){var e=this;void 0===t&&(t={}),!ir&&"undefined"!=typeof window&&window.Vue&&dr(window.Vue);var n=t.locale||"en-US",r=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),o=t.messages||{},i=t.dateTimeFormats||t.datetimeFormats||{},a=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||Or,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._fallbackRootWithEmptyString=void 0===t.fallbackRootWithEmptyString||!!t.fallbackRootWithEmptyString,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new xr,this._dataListeners=new Set,this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this._escapeParameterHtml=t.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in t&&(this.__VUE_I18N_BRIDGE__=t.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(t,n){var r=Object.getPrototypeOf(e);if(r&&r.getChoiceIndex)return r.getChoiceIndex.call(e,t,n);var o,i;return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):(o=t,i=n,o=Math.abs(o),2===i?o?o>1?1:0:1:o?Math.min(o,2):0)},this._exist=function(t,n){return!(!t||!n)&&(!qn(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(o).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,o[t])})),this._initVM({locale:n,fallbackLocale:r,messages:o,dateTimeFormats:i,numberFormats:a})},$r={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};Sr.prototype._checkLocaleMessage=function(t,e,n){var r=function(t,e,n,o){if(Hn(n))Object.keys(n).forEach((function(i){var a=n[i];Hn(a)?(o.push(i),o.push("."),r(t,e,a,o),o.pop(),o.pop()):(o.push(i),r(t,e,a,o),o.pop())}));else if(zn(n))n.forEach((function(n,i){Hn(n)?(o.push("["+i+"]"),o.push("."),r(t,e,n,o),o.pop(),o.pop()):(o.push("["+i+"]"),r(t,e,n,o),o.pop())}));else if(Un(n)){if(Er.test(n)){var i="Detected HTML in message '"+n+"' of keypath '"+o.join("")+"' at '"+e+"'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?Ln(i):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(i)}}};r(e,t,n,[])},Sr.prototype._initVM=function(t){var e=ir.config.silent;ir.config.silent=!0,this._vm=new ir({data:t,__VUE18N__INSTANCE__:!0}),ir.config.silent=e},Sr.prototype.destroyVM=function(){this._vm.$destroy()},Sr.prototype.subscribeDataChanging=function(t){this._dataListeners.add(t)},Sr.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.delete(e));}(this._dataListeners,t)},Sr.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",(function(){for(var e,n,r=(e=t._dataListeners,n=[],e.forEach((function(t){return n.push(t)})),n),o=r.length;o--;)ir.nextTick((function(){r[o]&&r[o].$forceUpdate()}))}),{deep:!0})},Sr.prototype.watchLocale=function(t){if(t){if(!this.__VUE_I18N_BRIDGE__)return null;var e=this,n=this._vm;return this.vm.$watch("locale",(function(r){n.$set(n,"locale",r),e.__VUE_I18N_BRIDGE__&&t&&(t.locale.value=r),n.$forceUpdate()}),{immediate:!0})}if(!this._sync||!this._root)return null;var r=this._vm;return this._root.$i18n.vm.$watch("locale",(function(t){r.$set(r,"locale",t),r.$forceUpdate()}),{immediate:!0})},Sr.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},$r.vm.get=function(){return this._vm},$r.messages.get=function(){return Gn(this._getMessages())},$r.dateTimeFormats.get=function(){return Gn(this._getDateTimeFormats())},$r.numberFormats.get=function(){return Gn(this._getNumberFormats())},$r.availableLocales.get=function(){return Object.keys(this.messages).sort()},$r.locale.get=function(){return this._vm.locale},$r.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},$r.fallbackLocale.get=function(){return this._vm.fallbackLocale},$r.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},$r.formatFallbackMessages.get=function(){return this._formatFallbackMessages},$r.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},$r.missing.get=function(){return this._missing},$r.missing.set=function(t){this._missing=t},$r.formatter.get=function(){return this._formatter},$r.formatter.set=function(t){this._formatter=t},$r.silentTranslationWarn.get=function(){return this._silentTranslationWarn},$r.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},$r.silentFallbackWarn.get=function(){return this._silentFallbackWarn},$r.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},$r.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},$r.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},$r.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},$r.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach((function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])}))}},$r.postTranslation.get=function(){return this._postTranslation},$r.postTranslation.set=function(t){this._postTranslation=t},$r.sync.get=function(){return this._sync},$r.sync.set=function(t){this._sync=t},Sr.prototype._getMessages=function(){return this._vm.messages},Sr.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},Sr.prototype._getNumberFormats=function(){return this._vm.numberFormats},Sr.prototype._warnDefault=function(t,e,n,r,o,i){if(!qn(n))return n;if(this._missing){var a=this._missing.apply(null,[t,e,r,o]);if(Un(a))return a}else 0;if(this._formatFallbackMessages){var s=Jn.apply(void 0,o);return this._render(e,i,s.params,e)}return e},Sr.prototype._isFallbackRoot=function(t){return(this._fallbackRootWithEmptyString?!t:qn(t))&&!qn(this._root)&&this._fallbackRoot},Sr.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},Sr.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},Sr.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},Sr.prototype._interpolate=function(t,e,n,r,o,i,a){if(!e)return null;var s,u=this._path.getPathValue(e,n);if(zn(u)||Hn(u))return u;if(qn(u)){if(!Hn(e))return null;if(!Un(s=e[n])&&!Wn(s))return null}else{if(!Un(u)&&!Wn(u))return null;s=u}return Un(s)&&(s.indexOf("@:")>=0||s.indexOf("@.")>=0)&&(s=this._link(t,e,s,r,"raw",i,a)),this._render(s,o,i,n)},Sr.prototype._link=function(t,e,n,r,o,i,a){var s=n,u=s.match(Ar);for(var c in u)if(u.hasOwnProperty(c)){var l=u[c],f=l.match(kr),p=f[0],d=f[1],h=l.replace(p,"").replace(Cr,"");if(Qn(a,h))return s;a.push(h);var v=this._interpolate(t,e,h,r,"raw"===o?"string":o,"raw"===o?void 0:i,a);if(this._isFallbackRoot(v)){if(!this._root)throw Error("unexpected error");var m=this._root.$i18n;v=m._translate(m._getMessages(),m.locale,m.fallbackLocale,h,r,o,i)}v=this._warnDefault(t,h,v,r,zn(i)?i:[i],o),this._modifiers.hasOwnProperty(d)?v=this._modifiers[d](v):Dr.hasOwnProperty(d)&&(v=Dr[d](v)),a.pop(),s=v?s.replace(l,v):s}return s},Sr.prototype._createMessageContext=function(t,e,n,r){var o=this,i=zn(t)?t:[],a=Nn(t)?t:{},s=this._getMessages(),u=this.locale;return{list:function(t){return i[t]},named:function(t){return a[t]},values:t,formatter:e,path:n,messages:s,locale:u,linked:function(t){return o._interpolate(u,s[u]||{},t,null,r,void 0,[t])}}},Sr.prototype._render=function(t,e,n,r){if(Wn(t))return t(this._createMessageContext(n,this._formatter||Or,r,e));var o=this._formatter.interpolate(t,n,r);return o||(o=Or.interpolate(t,n,r)),"string"!==e||Un(o)?o:o.join("")},Sr.prototype._appendItemToChain=function(t,e,n){var r=!1;return Qn(t,e)||(r=!0,e&&(r="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(r=n[e]))),r},Sr.prototype._appendLocaleToChain=function(t,e,n){var r,o=e.split("-");do{var i=o.join("-");r=this._appendItemToChain(t,i,n),o.splice(-1,1)}while(o.length&&!0===r);return r},Sr.prototype._appendBlockToChain=function(t,e,n){for(var r=!0,o=0;o<e.length&&"boolean"==typeof r;o++){var i=e[o];Un(i)&&(r=this._appendLocaleToChain(t,i,n))}return r},Sr.prototype._getLocaleChain=function(t,e){if(""===t)return[];this._localeChainCache||(this._localeChainCache={});var n=this._localeChainCache[t];if(!n){e||(e=this.fallbackLocale),n=[];for(var r,o=[t];zn(o);)o=this._appendBlockToChain(n,o,e);(o=Un(r=zn(e)?e:Nn(e)?e.default?e.default:null:e)?[r]:r)&&this._appendBlockToChain(n,o,null),this._localeChainCache[t]=n}return n},Sr.prototype._translate=function(t,e,n,r,o,i,a){for(var s,u=this._getLocaleChain(e,n),c=0;c<u.length;c++){var l=u[c];if(!qn(s=this._interpolate(l,t[l],r,o,i,a,[r])))return s}return null},Sr.prototype._t=function(t,e,n,r){for(var o,i=[],a=arguments.length-4;a-- >0;)i[a]=arguments[a+4];if(!t)return"";var s=Jn.apply(void 0,i);this._escapeParameterHtml&&(s.params=tr(s.params));var u=s.locale||e,c=this._translate(n,u,this.fallbackLocale,t,r,"string",s.params);if(this._isFallbackRoot(c)){if(!this._root)throw Error("unexpected error");return(o=this._root).$t.apply(o,[t].concat(i))}return c=this._warnDefault(u,t,c,r,i,"string"),this._postTranslation&&null!=c&&(c=this._postTranslation(c,t)),c},Sr.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},Sr.prototype._i=function(t,e,n,r,o){var i=this._translate(n,e,this.fallbackLocale,t,r,"raw",o);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,o)}return this._warnDefault(e,t,i,r,[o],"raw")},Sr.prototype.i=function(t,e,n){return t?(Un(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},Sr.prototype._tc=function(t,e,n,r,o){for(var i,a=[],s=arguments.length-5;s-- >0;)a[s]=arguments[s+5];if(!t)return"";void 0===o&&(o=1);var u={count:o,n:o},c=Jn.apply(void 0,a);return c.params=Object.assign(u,c.params),a=null===c.locale?[c.params]:[c.locale,c.params],this.fetchChoice((i=this)._t.apply(i,[t,e,n,r].concat(a)),o)},Sr.prototype.fetchChoice=function(t,e){if(!t||!Un(t))return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},Sr.prototype.tc=function(t,e){for(var n,r=[],o=arguments.length-2;o-- >0;)r[o]=arguments[o+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},Sr.prototype._te=function(t,e,n){for(var r=[],o=arguments.length-3;o-- >0;)r[o]=arguments[o+3];var i=Jn.apply(void 0,r).locale||e;return this._exist(n[i],t)},Sr.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},Sr.prototype.getLocaleMessage=function(t){return Gn(this._vm.messages[t]||{})},Sr.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},Sr.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,Zn(void 0!==this._vm.messages[t]&&Object.keys(this._vm.messages[t]).length?Object.assign({},this._vm.messages[t]):{},e))},Sr.prototype.getDateTimeFormat=function(t){return Gn(this._vm.dateTimeFormats[t]||{})},Sr.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},Sr.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,Zn(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},Sr.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(r)&&delete this._dateTimeFormatters[r]}},Sr.prototype._localizeDateTime=function(t,e,n,r,o){for(var i=e,a=r[i],s=this._getLocaleChain(e,n),u=0;u<s.length;u++){var c=s[u];if(i=c,!qn(a=r[c])&&!qn(a[o]))break}if(qn(a)||qn(a[o]))return null;var l=a[o],f=i+"__"+o,p=this._dateTimeFormatters[f];return p||(p=this._dateTimeFormatters[f]=new Intl.DateTimeFormat(i,l)),p.format(t)},Sr.prototype._d=function(t,e,n){if(!n)return new Intl.DateTimeFormat(e).format(t);var r=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n);if(this._isFallbackRoot(r)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return r||""},Sr.prototype.d=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.locale,o=null;return 1===e.length?Un(e[0])?o=e[0]:Nn(e[0])&&(e[0].locale&&(r=e[0].locale),e[0].key&&(o=e[0].key)):2===e.length&&(Un(e[0])&&(o=e[0]),Un(e[1])&&(r=e[1])),this._d(t,r,o)},Sr.prototype.getNumberFormat=function(t){return Gn(this._vm.numberFormats[t]||{})},Sr.prototype.setNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,e),this._clearNumberFormat(t,e)},Sr.prototype.mergeNumberFormat=function(t,e){this._vm.$set(this._vm.numberFormats,t,Zn(this._vm.numberFormats[t]||{},e)),this._clearNumberFormat(t,e)},Sr.prototype._clearNumberFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._numberFormatters.hasOwnProperty(r)&&delete this._numberFormatters[r]}},Sr.prototype._getNumberFormatter=function(t,e,n,r,o,i){for(var a=e,s=r[a],u=this._getLocaleChain(e,n),c=0;c<u.length;c++){var l=u[c];if(a=l,!qn(s=r[l])&&!qn(s[o]))break}if(qn(s)||qn(s[o]))return null;var f,p=s[o];if(i)f=new Intl.NumberFormat(a,Object.assign({},p,i));else{var d=a+"__"+o;(f=this._numberFormatters[d])||(f=this._numberFormatters[d]=new Intl.NumberFormat(a,p))}return f},Sr.prototype._n=function(t,e,n,r){if(!Sr.availabilities.numberFormat)return"";if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).format(t);var o=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),i=o&&o.format(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.n(t,Object.assign({},{key:n,locale:e},r))}return i||""},Sr.prototype.n=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.locale,o=null,i=null;return 1===e.length?Un(e[0])?o=e[0]:Nn(e[0])&&(e[0].locale&&(r=e[0].locale),e[0].key&&(o=e[0].key),i=Object.keys(e[0]).reduce((function(t,n){var r;return Qn(Rn,n)?Object.assign({},t,((r={})[n]=e[0][n],r)):t}),null)):2===e.length&&(Un(e[0])&&(o=e[0]),Un(e[1])&&(r=e[1])),this._n(t,r,o,i)},Sr.prototype._ntp=function(t,e,n,r){if(!Sr.availabilities.numberFormat)return[];if(!n)return(r?new Intl.NumberFormat(e,r):new Intl.NumberFormat(e)).formatToParts(t);var o=this._getNumberFormatter(t,e,this.fallbackLocale,this._getNumberFormats(),n,r),i=o&&o.formatToParts(t);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n._ntp(t,e,n,r)}return i||[]},Object.defineProperties(Sr.prototype,$r),Object.defineProperty(Sr,"availabilities",{get:function(){if(!_r){var t="undefined"!=typeof Intl;_r={dateTimeFormat:t&&void 0!==Intl.DateTimeFormat,numberFormat:t&&void 0!==Intl.NumberFormat}}return _r}}),Sr.install=dr,Sr.version="8.27.0";var jr=Sr; +/*! + * vssue - A vue-powered issue-based comment plugin + * + * @version v1.4.8 + * @link https://vssue.js.org + * @license MIT + * @copyright 2018-2021 meteorlxy + */ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */function Tr(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}var Pr=i.default.extend({name:"Iconfont"});function Br(t,e,n,r,o,i,a,s,u,c){"boolean"!=typeof a&&(u=s,s=a,a=!1);const l="function"==typeof n?n.options:n;let f;if(t&&t.render&&(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,o&&(l.functional=!0)),r&&(l._scopeId=r),i?(f=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,u(t)),t&&t._registeredComponents&&t._registeredComponents.add(i)},l._ssrRegister=f):e&&(f=a?function(t){e.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),f)if(l.functional){const t=l.render;l.render=function(e,n){return f.call(n),t(e,n)}}else{const t=l.beforeCreate;l.beforeCreate=t?[].concat(t,f):[f]}return n}"undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());const Fr=Br({render:function(t,e){var n=e._c;return n("svg",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}]},[n("symbol",{attrs:{id:"vssue-icon-bitbucket",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M579.5522464 489.45249493q4.8371808 38.38537173-30.81752427 61.55702827t-67.95459093 3.66689493q-23.79580907-10.37653333-32.6119616-35.34262826t-0.31207573-50.01020907 31.67573333-35.34262827q21.92335253-11.00068587 44.1587808-7.33379093t39.00952427 21.61127573 16.77409493 41.1160384zM647.19476053 476.65737173q-8.50407573-65.22392427-68.8908192-99.9424t-120.07131413-7.9579424q-38.38537173 17.08617173-61.24495253 53.9111616t-21.0651424 78.95527574q2.41859093 55.4715424 47.20152426 94.48106666t100.87862827 34.1723424q55.4715424-4.8371808 92.60860907-51.18049493t30.50544746-102.43900907zM792.93434133 146.32472427q-12.17097173-16.4620192-34.1723424-27.15062827t-35.34262826-13.41927573-43.30057174-7.64586667q-177.33729493-28.63299093-345.00022826 1.24830507-26.2144 4.29104747-40.25782827 7.33379093t-33.54819093 13.41927573-30.50544747 26.2144q18.2564576 17.08617173 46.34331413 27.6967616t44.78293334 13.41927574 53.36502826 7.02171413q138.95192427 17.71032427 273.06666667 0.62415253 38.38537173-4.8371808 54.53531413-7.33379093t44.1587808-13.1072 45.7191616-28.32091413zM827.65281813 777.10872427q-4.8371808 15.83786667-9.44030506 46.65539093t-8.50407574 51.18049493-17.39824746 42.6764192-35.34262827 34.4064q-52.4288 29.2571424-115.46819093 43.61264747t-123.1140576 13.41927573-122.8019808-11.3127616q-28.0088384-4.8371808-49.69813334-11.00068586t-46.65539093-16.4620192-44.4708576-26.52647574-31.67573333-37.4491424q-15.21371413-58.51428587-34.71847574-177.96144746l3.66689494-9.7523808 11.00068586-5.46133334q135.9091808 90.1900192 308.72137174 90.1900192t309.34552426-90.1900192q12.79512427 3.66689493 14.5895616 14.04342827t-3.0427424 27.46270507-4.8371808 22.54750506zM937.97175147 191.41973333q-15.83786667 101.8148576-67.64251414 399.22346667-3.0427424 18.2564576-16.4620192 34.1723424t-26.52647573 24.3419424-33.23611413 18.88060907q-153.61950507 76.7707424-371.8387808 53.67710506-151.12289493-16.4620192-240.14262827-84.72868586-9.12822827-7.33379093-15.52579093-16.1499424t-10.37653334-21.2992-5.46133333-20.75306667-3.66689493-24.10788587-3.3548192-21.2992q-5.46133333-30.50544747-16.1499424-91.43832426t-17.08617174-98.4600384-14.35550506-89.8779424-13.41927574-96.27550507q1.7944384-15.83786667 10.68860907-29.5692192t19.19268587-22.8595808 27.46270506-18.2564576 28.0088384-13.73135253 29.2571424-11.3127616q76.22460907-28.0088384 190.75657174-39.00952427 231.0144-22.54750507 412.01859093 30.50544747 94.48106667 28.0088384 131.072 74.35215253 9.7523808 12.17097173 10.0644576 31.0515808t-3.3548192 32.9240384z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-gitea",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M184.31868985 236.10860742C106.94832667 235.94086648 3.32655508 285.13080468 9.02973665 408.46209936c8.93218827 192.65010787 206.32096845 210.5144844 285.20099725 212.06608453 8.63864186 36.14810496 101.48307766 160.77938883 170.21479898 167.32127321h301.09442177c180.57278288-11.99345499 315.77172611-546.07960359 215.54670217-548.09249109-165.7696721 7.79993906-264.02374305 11.74184405-348.27147151 12.41280591v166.69224585l-26.25140843-11.61603761-0.16773997-154.99233728c-96.70246985-0.04193548-181.83083757-4.52899687-343.4069947-12.49667687-20.21274496-0.12580547-48.39316992-3.5644886-78.67035236-3.64835859z m10.94507577 68.14462849h9.22573371c10.98701124 98.75729283 28.85138778 156.50200291 64.99949274 244.73357185-92.25734394-10.90314029-170.75995634-37.69970509-185.18564974-137.75698809-7.46445813-51.78991757 17.69663558-105.84433456 110.96042329-107.01851827z m358.83913087 97.07988723c6.29027343 0.08386999 12.70635233 1.25805468 18.74501482 4.02577499l31.40943263 13.54505513-22.51917887 41.05451824a28.18042496 25.03528825 0 0 0-10.10637297 1.59353561 28.18042496 25.03528825 0 0 0-16.98373825 32.038459 28.18042496 25.03528825 0 0 0 4.69673781 7.29671718l-38.83195528 70.70267333a28.18042496 25.03528825 0 0 0-9.30960467 1.59353659 28.18042496 25.03528825 0 0 0-16.98373825 32.038459 28.18042496 25.03528825 0 0 0 36.06423497 15.09665623 28.18042496 25.03528825 0 0 0 16.94180276-32.08039449 28.18042496 25.03528825 0 0 0-6.62575434-9.22573468l37.82551056-68.85752581a28.18042496 25.03528825 0 0 0 12.28700044-1.25805469 28.18042496 25.03528825 0 0 0 8.93218826-4.69673783c14.59343435 6.12253248 26.54495386 11.11281671 35.14166122 15.34826717 12.91602778 6.37414341 17.48696012 10.60959485 18.87082027 15.30633169 1.38386015 4.61286685-0.12580547 13.50312062-7.42252263 29.10299872-5.45157063 11.61603859-14.46762889 28.09655497-25.11915823 47.51253164a28.18042496 25.03528825 0 0 0-10.52572486 1.59353659 28.18042496 25.03528825 0 0 0-16.98373826 32.038459 28.18042496 25.03528825 0 0 0 36.06423498 15.09665623 28.18042496 25.03528825 0 0 0 16.94180278-32.03845901 28.18042496 25.03528825 0 0 0-5.74511608-8.47090188c10.52572388-19.20630122 19.58371762-35.72875308 25.41270465-48.14155897 7.88380904-16.85793279 11.99345499-29.39654416 8.38703091-41.51580463-3.60642311-12.11926046-14.67730434-20.0030695-29.35460966-27.25785217-9.6450856-4.73867233-21.68047607-9.77089106-36.06423399-15.80955357a28.18042496 25.03528825 0 0 0-1.59353562-10.022502 28.18042496 25.03528825 0 0 0-6.08059796-8.7644483l22.14176246-40.38355541 122.61839638 52.96410227c22.14176247 9.6031511 31.2836262 33.12877372 20.54822685 52.8382968l-84.28966393 154.32137544c-10.77733482 19.66758857-37.23841869 27.80300855-59.38018118 18.24179293l-173.48574115-74.98005927c-22.14176247-9.5612156-31.32556167-33.12877372-20.54822687-52.83829679l84.28966395-154.27943995c7.38058716-13.54505513 22.22563246-21.59660511 37.951317-22.22563246h2.68384935z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-gitee",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M978.404275 409.561604H455.061338c-25.117645 0-45.499734 20.382089-45.499734 45.499734l-0.031997 113.781333c0 25.117645 20.350092 45.499734 45.499734 45.531731h318.594132c25.117645 0 45.499734 20.382089 45.499734 45.499735v22.749867a136.5312 136.5312 0 0 1-136.5312 136.5312H250.248539a45.499734 45.499734 0 0 1-45.499734-45.499734V341.343999a136.5312 136.5312 0 0 1 136.5312-136.5312L978.308284 204.780802c25.117645 0 45.499734-20.350092 45.499734-45.467738L1023.904009 45.531731h0.031997A45.499734 45.499734 0 0 0 978.468269 0h-0.031997L341.343999 0.031997C152.84967 0.031997 0.031997 152.84967 0.031997 341.343999v637.092273c0 25.117645 20.382089 45.499734 45.499734 45.499734h671.233072a307.171203 307.171203 0 0 0 307.171203-307.171203v-261.671468c0-25.117645-20.382089-45.499734-45.499734-45.499734z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-github",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M512 20.4425c-278.334 0-504 225.6345-504 504 0 222.6735 144.4275 411.6105 344.673 478.233 25.2 4.662 34.461-10.9305 34.461-24.255 0-12.0015-0.4725-51.723-0.693-93.8385-140.238 30.492-169.8165-59.472-169.8165-59.472-22.932-58.2435-55.944-73.7415-55.944-73.7415-45.738-31.2795 3.465-30.6495 3.465-30.6495 50.589 3.5595 77.238 51.9435 77.238 51.9435 44.9505 77.049 117.9045 54.7785 146.664 41.895 4.5045-32.571 17.577-54.81 32.004-67.41-111.951-12.726-229.635-55.9755-229.635-249.0705 0-55.0305 19.6875-99.981 51.9435-135.2925-5.229-12.6945-22.491-63.945 4.8825-133.371 0 0 42.336-13.545 138.6315 51.66 40.194-11.1825 83.3175-16.758 126.1575-16.9785 42.8085 0.189 85.9635 5.796 126.252 16.9785 96.201-65.205 138.4425-51.66 138.4425-51.66 27.4365 69.426 10.1745 120.6765 4.9455 133.371 32.319 35.28 51.8805 80.262 51.8805 135.2925 0 193.5675-117.9045 236.187-230.139 248.6925 18.081 15.6555 34.1775 46.305 34.1775 93.3345 0 67.4415-0.5985 121.716-0.5985 138.3165 0 13.419 9.072 29.1375 34.6185 24.192 200.151-66.717 344.3895-255.5595 344.3895-478.17 0-278.3655-225.666-504-504-504z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-gitlab",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M66.61375986 405.11600042L512.11376028 976.03999972 23.84576 621.65599958a39.312 39.312 0 0 1-14.07600042-43.30799944l56.8080007-173.26800028z m259.88400014 0h371.26800014L512.14975986 976.03999972zM215.11376 60.88400042l111.384 344.232H66.61375986l111.384-344.232a19.72800014 19.72800014 0 0 1 37.11600014 0z m742.49999972 344.232l56.8080007 173.2679993a39.23999986 39.23999986 0 0 1-14.07600042 43.30800042l-488.26800028 354.38400014 445.50000042-570.92400028z m0 0h-259.88400014l111.384-344.232a19.72800014 19.72800014 0 0 1 37.11600014 0z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-loading",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M843.307 742.24c0 3.217 2.607 5.824 5.824 5.824s5.824-2.607 5.824-5.824a5.823 5.823 0 0 0-5.824-5.824 5.823 5.823 0 0 0-5.824 5.824zM714.731 874.912c0 6.398 5.186 11.584 11.584 11.584s11.584-5.186 11.584-11.584-5.186-11.584-11.584-11.584-11.584 5.186-11.584 11.584zM541.419 943.2c0 9.614 7.794 17.408 17.408 17.408s17.408-7.794 17.408-17.408-7.794-17.408-17.408-17.408-17.408 7.794-17.408 17.408z m-186.56-9.152c0 12.795 10.373 23.168 23.168 23.168s23.168-10.373 23.168-23.168-10.373-23.168-23.168-23.168-23.168 10.373-23.168 23.168zM189.355 849.12c0 16.012 12.98 28.992 28.992 28.992s28.992-12.98 28.992-28.992-12.98-28.992-28.992-28.992-28.992 12.98-28.992 28.992zM74.731 704.736c0 19.228 15.588 34.816 34.816 34.816s34.816-15.588 34.816-34.816-15.588-34.816-34.816-34.816-34.816 15.588-34.816 34.816z m-43.008-177.28c0 22.41 18.166 40.576 40.576 40.576s40.576-18.166 40.576-40.576-18.166-40.576-40.576-40.576-40.576 18.166-40.576 40.576z m35.392-176.128c0 25.626 20.774 46.4 46.4 46.4s46.4-20.774 46.4-46.4c0-25.626-20.774-46.4-46.4-46.4-25.626 0-46.4 20.774-46.4 46.4z m106.176-142.016c0 28.843 23.381 52.224 52.224 52.224s52.224-23.381 52.224-52.224c0-28.843-23.381-52.224-52.224-52.224-28.843 0-52.224 23.381-52.224 52.224z m155.904-81.344c0 32.024 25.96 57.984 57.984 57.984s57.984-25.96 57.984-57.984-25.96-57.984-57.984-57.984-57.984 25.96-57.984 57.984z m175.104-5.056c0 35.24 28.568 63.808 63.808 63.808s63.808-28.568 63.808-63.808c0-35.24-28.568-63.808-63.808-63.808-35.24 0-63.808 28.568-63.808 63.808z m160.32 72.128c0 38.421 31.147 69.568 69.568 69.568s69.568-31.147 69.568-69.568-31.147-69.568-69.568-69.568-69.568 31.147-69.568 69.568z m113.92 135.488c0 41.638 33.754 75.392 75.392 75.392s75.392-33.754 75.392-75.392-33.754-75.392-75.392-75.392-75.392 33.754-75.392 75.392z m45.312 175.488c0 44.854 36.362 81.216 81.216 81.216s81.216-36.362 81.216-81.216c0-44.854-36.362-81.216-81.216-81.216-44.854 0-81.216 36.362-81.216 81.216z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-like",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M885.9 533.7c16.8-22.2 26.1-49.4 26.1-77.7 0-44.9-25.1-87.4-65.5-111.1a67.67 67.67 0 0 0-34.3-9.3H572.4l6-122.9c1.4-29.7-9.1-57.9-29.5-79.4-20.5-21.5-48.1-33.4-77.9-33.4-52 0-98 35-111.8 85.1l-85.9 311H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h601.3c9.2 0 18.2-1.8 26.5-5.4 47.6-20.3 78.3-66.8 78.3-118.4 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7 0-12.6-1.8-25-5.4-37 16.8-22.2 26.1-49.4 26.1-77.7-0.2-12.6-2-25.1-5.6-37.1zM184 852V568h81v284h-81z m636.4-353l-21.9 19 13.9 25.4c4.6 8.4 6.9 17.6 6.9 27.3 0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4c4.6 8.4 6.9 17.6 6.9 27.3 0 16.5-7.2 32.2-19.6 43l-21.9 19 13.9 25.4c4.6 8.4 6.9 17.6 6.9 27.3 0 22.4-13.2 42.6-33.6 51.8H329V564.8l99.5-360.5c5.2-18.9 22.5-32.2 42.2-32.3 7.6 0 15.1 2.2 21.1 6.7 9.9 7.4 15.2 18.6 14.6 30.5l-9.6 198.4h314.4C829 418.5 840 436.9 840 456c0 16.5-7.2 32.1-19.6 43z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-unlike",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M885.9 490.3c3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-28.3-9.3-55.5-26.1-77.7 3.6-12 5.4-24.4 5.4-37 0-51.6-30.7-98.1-78.3-118.4-8.3-3.6-17.2-5.4-26.5-5.4H144c-17.7 0-32 14.3-32 32v364c0 17.7 14.3 32 32 32h129.3l85.8 310.8C372.9 889 418.9 924 470.9 924c29.7 0 57.4-11.8 77.9-33.4 20.5-21.5 31-49.7 29.5-79.4l-6-122.9h239.9c12.1 0 23.9-3.2 34.3-9.3 40.4-23.5 65.5-66.1 65.5-111 0-28.3-9.3-55.5-26.1-77.7zM184 456V172h81v284h-81z m627.2 160.4H496.8l9.6 198.4c0.6 11.9-4.7 23.1-14.6 30.5-6.1 4.5-13.6 6.8-21.1 6.7-19.6-0.1-36.9-13.4-42.2-32.3L329 459.2V172h415.4c20.4 9.2 33.6 29.4 33.6 51.8 0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19c12.5 10.8 19.6 26.5 19.6 43 0 9.7-2.3 18.9-6.9 27.3l-13.9 25.4 21.9 19c12.5 10.8 19.6 26.5 19.6 43 0 9.7-2.3 18.9-6.9 27.3l-14 25.5 21.9 19c12.5 10.8 19.6 26.5 19.6 43 0 19.1-11 37.5-28.8 48.4z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-heart",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M923 283.6c-13.4-31.1-32.6-58.9-56.9-82.8-24.3-23.8-52.5-42.4-84-55.5-32.5-13.5-66.9-20.3-102.4-20.3-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5-24.4 23.9-43.5 51.7-56.9 82.8-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3 0.1-35.3-7-69.6-20.9-101.9zM512 814.8S156 586.7 156 385.5C156 283.6 240.3 201 344.3 201c73.1 0 136.5 40.8 167.7 100.4C543.2 241.8 606.6 201 679.7 201c104 0 188.3 82.6 188.3 184.5 0 201.2-356 429.3-356 429.3z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-edit",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M723.2 917.76H286.72c-65.28 0-118.4-51.2-118.4-113.92V261.76C168.32 198.4 221.44 147.2 286.72 147.2h375.04c17.92 0 32 14.08 32 32s-14.08 32-32 32H286.72c-30.08 0-54.4 22.4-54.4 49.92v542.08c0 27.52 24.32 49.92 54.4 49.92H723.2c30.08 0 54.4-22.4 54.4-49.92V440.32c0-17.92 14.08-32 32-32s32 14.08 32 32v363.52c0 62.72-53.12 113.92-118.4 113.92z"}}),e._v(" "),n("path",{attrs:{d:"M499.84 602.24c-7.68 0-14.72-2.56-21.12-7.68-13.44-11.52-14.72-32-3.2-45.44L780.16 198.4c11.52-13.44 32-14.72 45.44-3.2s14.72 32 3.2 45.44L524.16 591.36c-6.4 7.04-15.36 10.88-24.32 10.88z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-delete",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M677.647059 256l0-90.352941c0-37.436235-23.461647-60.235294-61.771294-60.235294L408.094118 105.411765c-38.249412 0-61.741176 22.799059-61.741176 60.235294l0 90.352941-180.705882 0 0 60.235294 60.235294 0 0 512c0 54.272 33.972706 90.352941 90.352941 90.352941l391.529412 0c55.085176 0 90.352941-33.490824 90.352941-90.352941l0-512 60.235294 0 0-60.235294L677.647059 256zM406.588235 165.647059l210.823529 0-1.264941 90.352941L406.588235 256 406.588235 165.647059zM737.882353 858.352941l-451.764706 0 0-542.117647 451.764706 0L737.882353 858.352941zM466.823529 376.470588l-58.729412 0-1.505882 391.529412 60.235294 0L466.823529 376.470588zM617.411765 376.470588l-60.235294 0 0 391.529412 60.235294 0L617.411765 376.470588z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-reply",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M426.666667 384 426.666667 213.333333 128 512 426.666667 810.666667 426.666667 635.733333C640 635.733333 789.333333 704 896 853.333333 853.333333 640 725.333333 426.666667 426.666667 384Z"}})]),e._v(" "),n("symbol",{attrs:{id:"vssue-icon-error",viewBox:"0 0 1024 1024"}},[n("path",{attrs:{d:"M512 720m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}}),e._v(" "),n("path",{attrs:{d:"M480 416v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8z"}}),e._v(" "),n("path",{attrs:{d:"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48z m-783.5-27.9L512 239.9l339.8 588.2H172.2z"}})])])},staticRenderFns:[]},void 0,Pr,void 0,!0,void 0,!1,void 0,void 0,void 0);const Ir=Br({},void 0,i.default.extend({name:"TransitionFade",functional:!0,props:{group:{type:Boolean,required:!1,default:!1},tag:{type:String,required:!1,default:"div"}},render:(t,{props:e,children:n})=>t(e.group?"TransitionGroup":"Transition",{props:{name:"fade",mode:"out-in",appear:!0,tag:e.tag}},n)}),void 0,void 0,void 0,!1,void 0,void 0,void 0);const Mr=Br({},void 0,i.default.extend({name:"VssueIcon",functional:!0,props:{name:{type:String,required:!0},title:{type:String,required:!1,default:null}},render:(t,{props:e,data:n})=>t("svg",Object.assign(Object.assign({},n),{class:["vssue-icon","vssue-icon-"+e.name],attrs:{"aria-hidden":"true"}}),[t("title",e.title),t("use",{attrs:{"xlink:href":"#vssue-icon-"+e.name}})])}),void 0,void 0,void 0,!1,void 0,void 0,void 0);let Rr=class extends i.default{constructor(){super(...arguments),this.editMode=!1,this.editContent=this.comment.contentRaw,this.creatingReactions=[],this.isPutingComment=!1,this.isDeletingComment=!1}get currentUser(){return this.vssue.user?this.vssue.user.username:null}get content(){return this.comment.content}get author(){return this.comment.author}get createdAt(){return Fn(this.comment.createdAt)}get updatedAt(){return Fn(this.comment.updatedAt)}get showReactions(){return Boolean(this.vssue.API&&this.vssue.API.platform.meta.reactable&&this.comment.reactions&&!this.editMode)}get reactionKeys(){return["heart","like","unlike"]}get editContentRows(){return this.editContent.split("\n").length-1}get editInputRows(){return this.editContentRows<3?5:this.editContentRows+2}async postReaction({reaction:t}){try{if(this.creatingReactions.includes(t))return;this.creatingReactions.push(t);await this.vssue.postCommentReaction({commentId:this.comment.id,reaction:t})||this.vssue.$emit("error",new Error(this.vssue.$t("reactionGiven",{reaction:this.vssue.$t(t)})));const e=await this.vssue.getCommentReactions({commentId:this.comment.id});e&&(this.comment.reactions=e)}finally{this.creatingReactions.splice(this.creatingReactions.findIndex(e=>e===t),1)}}enterEdit(){this.editMode=!0,this.$nextTick(()=>{this.$refs.input.focus()})}resetEdit(){this.editMode=!1,this.editContent=this.comment.contentRaw}async putComment(){try{if(this.vssue.isPending)return;if(this.editContent!==this.comment.contentRaw){this.isPutingComment=!0,this.vssue.isUpdatingComment=!0;const t=await this.vssue.putComment({commentId:this.comment.id,content:this.editContent});t&&this.vssue.comments.data.splice(this.vssue.comments.data.findIndex(t=>t.id===this.comment.id),1,t)}this.editMode=!1}finally{this.isPutingComment=!1,this.vssue.isUpdatingComment=!1}}async deleteComment(){try{if(this.vssue.isPending)return;if(!window.confirm(this.vssue.$t("deleteConfirm")))return;this.isDeletingComment=!0,this.vssue.isUpdatingComment=!0;await this.vssue.deleteComment({commentId:this.comment.id})?(this.vssue.comments.count-=1,this.vssue.comments.data.length>1&&this.vssue.comments.data.splice(this.vssue.comments.data.findIndex(t=>t.id===this.comment.id),1),this.vssue.query.page>1&&this.vssue.query.page>Math.ceil(this.vssue.comments.count/this.vssue.query.perPage)?this.vssue.query.page-=1:await this.vssue.getComments()):this.vssue.$emit("error",new Error(this.vssue.$t("deleteFailed")))}finally{this.isDeletingComment=!1,this.vssue.isUpdatingComment=!1}}};Tr([Dn({type:Object,required:!0})],Rr.prototype,"comment",void 0),Tr([_n()],Rr.prototype,"vssue",void 0),Rr=Tr([Object(xn.b)({components:{VssueIcon:Mr}})],Rr);const Lr=Br({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vssue-comment",class:{"vssue-comment-edit-mode":t.editMode,"vssue-comment-disabled":t.isDeletingComment||t.isPutingComment}},[n("div",{staticClass:"vssue-comment-avatar"},[n("a",{attrs:{href:t.author.homepage,title:t.author.username,target:"_blank",rel:"noopener noreferrer"}},[n("img",{attrs:{src:t.author.avatar,alt:t.author.username}})])]),t._v(" "),n("div",{staticClass:"vssue-comment-body"},[t._t("body",[n("div",{staticClass:"vssue-comment-header"},[n("span",{staticClass:"vssue-comment-author"},[n("a",{attrs:{href:t.author.homepage,title:t.author.username,target:"_blank",rel:"noopener noreferrer"}},[t._v("\n "+t._s(t.author.username)+"\n ")])]),t._v(" "),n("span",{staticClass:"vssue-comment-created-at"},[t._v("\n "+t._s(t.createdAt)+"\n ")])]),t._v(" "),n("div",{staticClass:"vssue-comment-main"},[t.editMode?n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.editContent,expression:"editContent"}],ref:"input",staticClass:"vssue-edit-comment-input",attrs:{rows:t.editInputRows},domProps:{value:t.editContent},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.putComment():null},input:function(e){e.target.composing||(t.editContent=e.target.value)}}}):n("article",{staticClass:"markdown-body",domProps:{innerHTML:t._s(t.content)}})]),t._v(" "),n("div",{staticClass:"vssue-comment-footer"},[t.editMode?n("span",{staticClass:"vssue-comment-hint"},[t._v("\n "+t._s(t.vssue.$t("editMode"))+"\n ")]):t._e(),t._v(" "),t.showReactions?n("span",{staticClass:"vssue-comment-reactions"},t._l(t.reactionKeys,(function(e){return n("span",{key:e,staticClass:"vssue-comment-reaction",attrs:{title:t.vssue.$t(t.creatingReactions.includes(e)?"loading":e)},on:{click:function(n){return t.postReaction({reaction:e})}}},[n("VssueIcon",{attrs:{name:t.creatingReactions.includes(e)?"loading":e,title:t.vssue.$t(t.creatingReactions.includes(e)?"loading":e)}}),t._v(" "),n("span",{staticClass:"vssue-comment-reaction-number"},[t._v("\n "+t._s(t.comment.reactions[e])+"\n ")])],1)})),0):t._e(),t._v(" "),n("span",{staticClass:"vssue-comment-operations"},[t.comment.author.username===t.currentUser&&t.editMode?n("span",{staticClass:"vssue-comment-operation",class:{"vssue-comment-operation-muted":t.isPutingComment},attrs:{title:t.vssue.$t(t.isPutingComment?"loading":"submit")},on:{click:function(e){return t.putComment()}}},[n("VssueIcon",{directives:[{name:"show",rawName:"v-show",value:t.isPutingComment,expression:"isPutingComment"}],attrs:{name:"loading",title:t.vssue.$t("loading")}}),t._v("\n\n "+t._s(t.vssue.$t("submit"))+"\n ")],1):t._e(),t._v(" "),t.comment.author.username===t.currentUser&&t.editMode?n("span",{staticClass:"vssue-comment-operation vssue-comment-operation-muted",attrs:{title:t.vssue.$t("cancel")},on:{click:function(e){return t.resetEdit()}}},[t._v("\n "+t._s(t.vssue.$t("cancel"))+"\n ")]):t._e(),t._v(" "),t.comment.author.username===t.currentUser?n("span",{directives:[{name:"show",rawName:"v-show",value:!t.editMode,expression:"!editMode"}],staticClass:"vssue-comment-operation",on:{click:function(e){return t.enterEdit()}}},[n("VssueIcon",{attrs:{name:"edit",title:t.vssue.$t("edit")}})],1):t._e(),t._v(" "),t.comment.author.username===t.currentUser||t.vssue.isAdmin?n("span",{directives:[{name:"show",rawName:"v-show",value:!t.editMode,expression:"!editMode"}],staticClass:"vssue-comment-operation",on:{click:function(e){return t.deleteComment()}}},[n("VssueIcon",{attrs:{name:t.isDeletingComment?"loading":"delete",title:t.vssue.$t(t.isDeletingComment?"loading":"delete")}})],1):t._e(),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:!t.editMode,expression:"!editMode"}],staticClass:"vssue-comment-operation",on:{click:function(e){return t.vssue.$emit("reply-comment",t.comment)}}},[n("VssueIcon",{attrs:{name:"reply",title:t.vssue.$t("reply")}})],1)])])])],2)])},staticRenderFns:[]},void 0,Rr,void 0,!1,void 0,!1,void 0,void 0,void 0);let zr=class extends i.default{get disabled(){return this.vssue.isPending}get pageCount(){const t=Math.ceil(this.vssue.comments.count/this.vssue.comments.perPage);return t>1?t:1}get perPageOptions(){const t=[5,10,20,50];return!t.includes(this.vssue.options.perPage)&&this.vssue.options.perPage<100&&t.push(this.vssue.options.perPage),t.sort((t,e)=>t-e)}get page(){return this.vssue.query.page>this.pageCount?this.pageCount:this.vssue.query.page}set page(t){t>0&&t<=this.pageCount&&(this.vssue.query.page=t)}get perPage(){return this.vssue.query.perPage}set perPage(t){this.perPageOptions.includes(t)&&(this.vssue.query.perPage=t)}};Tr([_n()],zr.prototype,"vssue",void 0),zr=Tr([Object(xn.b)({components:{VssueIcon:Mr}})],zr);const Nr=Br({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vssue-pagination"},[n("div",{staticClass:"vssue-pagination-per-page"},[n("label",[n("select",{directives:[{name:"model",rawName:"v-model",value:t.perPage,expression:"perPage"}],staticClass:"vssue-pagination-select",attrs:{disabled:t.disabled},on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.perPage=e.target.multiple?n:n[0]}}},t._l(t.perPageOptions,(function(e){return n("option",{key:e,domProps:{value:e}},[t._v("\n "+t._s(e)+"\n ")])})),0),t._v(" "),n("span",[t._v("\n "+t._s(t.vssue.$t("perPage"))+"\n ")])]),t._v(" "),t.vssue.API.platform.meta.sortable?n("span",{class:{"vssue-pagination-link":!0,disabled:t.disabled},attrs:{title:t.vssue.$t("sort")},on:{click:function(e){t.vssue.query.sort="asc"===t.vssue.query.sort?"desc":"asc"}}},[t._v("\n "+t._s("asc"===t.vssue.query.sort?"↑":"↓")+"\n ")]):t._e()]),t._v(" "),n("div",{staticClass:"vssue-pagination-page"},[n("span",{class:{"vssue-pagination-link":!0,disabled:1===t.page||t.disabled},attrs:{title:t.vssue.$t("prev")},domProps:{textContent:t._s("<")},on:{click:function(e){t.page-=1}}}),t._v(" "),n("label",[n("span",[t._v("\n "+t._s(t.vssue.$t("page"))+"\n ")]),t._v(" "),n("select",{directives:[{name:"show",rawName:"v-show",value:t.pageCount>1,expression:"pageCount > 1"},{name:"model",rawName:"v-model",value:t.page,expression:"page"}],staticClass:"vssue-pagination-select",attrs:{disabled:t.disabled},on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.page=e.target.multiple?n:n[0]}}},t._l(t.pageCount,(function(e){return n("option",{key:e,domProps:{value:e}},[t._v("\n "+t._s(e)+"\n ")])})),0),t._v(" "),n("span",{directives:[{name:"show",rawName:"v-show",value:t.pageCount<2,expression:"pageCount < 2"}],domProps:{textContent:t._s(t.page)}}),t._v(" "),n("span",{domProps:{textContent:t._s(" / "+t.pageCount+" ")}})]),t._v(" "),n("span",{class:{"vssue-pagination-link":!0,disabled:t.page===t.pageCount||t.disabled},attrs:{title:t.vssue.$t("next")},domProps:{textContent:t._s(">")},on:{click:function(e){t.page+=1}}})])])},staticRenderFns:[]},void 0,zr,void 0,!1,void 0,!1,void 0,void 0,void 0);let Ur=class extends i.default{};Tr([_n()],Ur.prototype,"vssue",void 0),Ur=Tr([Object(xn.b)({components:{TransitionFade:Ir,VssueComment:Lr,VssuePagination:Nr}})],Ur);const Vr=Br({render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"vssue-comments"},[e("VssuePagination"),this._v(" "),e("TransitionFade",{attrs:{group:""}},this._l(this.vssue.comments.data,(function(t){return e("VssueComment",{key:t.id,attrs:{comment:t}})})),1),this._v(" "),e("VssuePagination",{directives:[{name:"show",rawName:"v-show",value:this.vssue.comments.data.length>5,expression:"vssue.comments.data.length > 5"}]})],1)},staticRenderFns:[]},void 0,Ur,void 0,!1,void 0,!1,void 0,void 0,void 0);const Hr=Br({},void 0,i.default.extend({name:"VssueIcon",functional:!0,props:{type:{type:String,required:!1,default:"default"}},render:(t,{props:e,data:n,children:r})=>t("button",Object.assign(Object.assign({},n),{class:["vssue-button","vssue-button-"+e.type]}),r)}),void 0,void 0,void 0,!1,void 0,void 0,void 0);let qr=class extends i.default{constructor(){super(...arguments),this.content=""}get user(){return this.vssue.user}get platform(){return this.vssue.API&&this.vssue.API.platform.name}get isInputDisabled(){return this.loading||null===this.user||null===this.vssue.issue}get isSubmitDisabled(){return""===this.content||this.vssue.isPending||null===this.vssue.issue}get loading(){return this.vssue.isCreatingComment}get contentRows(){return this.content.split("\n").length-1}get inputRows(){return this.contentRows<3?5:this.contentRows+2}created(){this.vssue.$on("reply-comment",t=>{const e=t.contentRaw.replace(/\n/g,"\n> "),n=`@${t.author.username}\n\n> ${e}\n\n`;this.content=this.content.concat(n),this.focus()})}beforeDestroy(){this.vssue.$off("reply-comment")}focus(){this.$refs.input.focus()}async submit(){this.isSubmitDisabled||(await this.vssue.postComment({content:this.content}),this.content="",await this.vssue.getComments())}};Tr([_n()],qr.prototype,"vssue",void 0),qr=Tr([Object(xn.b)({components:{VssueButton:Hr,VssueIcon:Mr}})],qr);const Wr=Br({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vssue-new-comment"},[n("div",{staticClass:"vssue-comment-avatar"},[t.user?n("a",{attrs:{href:t.user.homepage,title:t.user.username,target:"_blank",rel:"noopener noreferrer"}},[n("img",{attrs:{src:t.user.avatar,alt:t.user.username}})]):n("VssueIcon",{attrs:{name:t.platform.toLowerCase(),title:t.vssue.$t("loginToComment",{platform:t.platform})},on:{click:function(e){return t.vssue.login()}}})],1),t._v(" "),n("div",{staticClass:"vssue-new-comment-body"},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.content,expression:"content"}],ref:"input",staticClass:"vssue-new-comment-input",attrs:{rows:t.inputRows,disabled:t.isInputDisabled,placeholder:t.vssue.$t(t.user?"placeholder":"noLoginPlaceHolder"),spellcheck:!1,"aria-label":"leave a comment"},domProps:{value:t.content},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:e.ctrlKey?t.submit():null},input:function(e){e.target.composing||(t.content=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"vssue-new-comment-footer"},[t.user?n("span",{staticClass:"vssue-current-user"},[n("span",[t._v(t._s(t.vssue.$t("currentUser"))+" - "+t._s(t.user.username)+" - ")]),t._v(" "),n("a",{staticClass:"vssue-logout",on:{click:function(e){return t.vssue.logout()}}},[t._v("\n "+t._s(t.vssue.$t("logout"))+"\n ")])]):n("span",{staticClass:"vssue-current-user"},[t._v("\n "+t._s(t.vssue.$t("loginToComment",{platform:t.platform}))+"\n ")]),t._v(" "),n("div",{staticClass:"vssue-new-comment-operations"},[t.user?n("VssueButton",{staticClass:"vssue-button-submit-comment",attrs:{type:"primary",disabled:t.isSubmitDisabled},on:{click:function(e){return t.submit()}}},[n("VssueIcon",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}],attrs:{name:"loading"}}),t._v("\n\n "+t._s(t.vssue.$t(t.loading?"submitting":"submitComment"))+"\n ")],1):n("VssueButton",{staticClass:"vssue-button-login",attrs:{type:"primary",title:t.vssue.$t("loginToComment",{platform:t.platform})},on:{click:function(e){return t.vssue.login()}}},[t._v("\n "+t._s(t.vssue.$t("login",{platform:t.platform}))+"\n ")])],1)])])},staticRenderFns:[]},void 0,qr,void 0,!1,void 0,!1,void 0,void 0,void 0);let Jr=class extends i.default{constructor(){super(...arguments),this.progress={show:!1,percent:0,timer:null,speed:200},this.alert={show:!1,message:null,timer:null}}onLoadingCommentsChange(t){this.vssue.comments&&(t?this.progressStart():this.progressDone())}created(){this.vssue.$on("error",t=>this.alertShow(t.message))}beforeDestroy(){this.vssue.$off("error"),null!==this.progress.timer&&window.clearTimeout(this.progress.timer),null!==this.alert.timer&&window.clearTimeout(this.alert.timer)}progressStart(){this.progress.show=!0,this.progress.percent=0,this.progress.timer=window.setInterval(()=>{this.progress.percent+=5,this.progress.percent>94&&null!==this.progress.timer&&window.clearInterval(this.progress.timer)},this.progress.speed)}progressDone(){this.progress.percent=100,null!==this.progress.timer&&window.clearTimeout(this.progress.timer),this.progress.timer=null,window.setTimeout(()=>{this.progress.show=!1},this.progress.speed)}alertShow(t){this.alert.show=!0,this.alert.message=t,null!==this.alert.timer&&window.clearTimeout(this.alert.timer),this.alert.timer=window.setTimeout(()=>{this.alertHide()},3e3)}alertHide(){this.alert.show=!1,null!==this.alert.timer&&window.clearTimeout(this.alert.timer),this.alert.timer=null}};Tr([_n()],Jr.prototype,"vssue",void 0),Tr([On("vssue.isLoadingComments")],Jr.prototype,"onLoadingCommentsChange",null),Jr=Tr([Object(xn.b)({components:{TransitionFade:Ir}})],Jr);const Gr=Br({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vssue-notice"},[n("div",{directives:[{name:"show",rawName:"v-show",value:t.progress.show,expression:"progress.show"}],staticClass:"vssue-progress",style:{width:t.progress.percent+"%",transition:"all "+t.progress.speed+"ms linear"}}),t._v(" "),n("TransitionFade",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.alert.show,expression:"alert.show"}],staticClass:"vssue-alert",domProps:{textContent:t._s(t.alert.message)},on:{click:function(e){return t.alertHide()}}})])],1)},staticRenderFns:[]},void 0,Jr,void 0,!1,void 0,!1,void 0,void 0,void 0);let Qr=class extends i.default{get status(){return this.vssue.isFailed?"failed":this.vssue.isInitializing?"initializing":this.vssue.isIssueNotCreated&&!this.vssue.isCreatingIssue?this.vssue.isAdmin||!this.vssue.isLogined?"issueNotCreated":"failed":this.vssue.isLoginRequired?"loginRequired":!this.vssue.comments||this.vssue.isCreatingIssue?"loadingComments":0===this.vssue.comments.data.length?"noComments":null}handleClick(){"issueNotCreated"===this.status?this.vssue.postIssue():"loginRequired"===this.status&&this.vssue.login()}};Tr([_n()],Qr.prototype,"vssue",void 0),Qr=Tr([Object(xn.b)({components:{TransitionFade:Ir,VssueIcon:Mr}})],Qr);const Yr=Br({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("TransitionFade",[t.status?n("div",{key:t.status,staticClass:"vssue-status"},[["failed","loadingComments","initializing"].includes(t.status)?n("VssueIcon",{attrs:{name:"failed"===t.status?"error":"loading"}}):t._e(),t._v(" "),n("p",{staticClass:"vssue-status-info"},[n(["issueNotCreated","loginRequired"].includes(t.status)?"a":"span",{tag:"Component",on:{click:t.handleClick}},[t._v("\n "+t._s(t.vssue.$t(t.status))+"\n ")])],1)],1):t._e()])},staticRenderFns:[]},void 0,Qr,void 0,!1,void 0,!1,void 0,void 0,void 0);let Kr=class extends i.default{};Tr([_n()],Kr.prototype,"vssue",void 0),Kr=Tr([Object(xn.b)({components:{TransitionFade:Ir,VssueIcon:Mr,VssueComments:Vr,VssueNewComment:Wr,VssueNotice:Gr,VssueStatus:Yr}})],Kr);const Zr=Br({render:function(){var t=this.$createElement,e=this._self._c||t;return e("TransitionFade",[this.vssue.isInitializing?e("VssueStatus"):e("div",{staticClass:"vssue-body"},[this.vssue.API?e("VssueNewComment"):this._e(),this._v(" "),e("VssueNotice"),this._v(" "),e("TransitionFade",[this.vssue.comments&&this.vssue.comments.data.length>0?e("VssueComments"):e("VssueStatus")],1)],1)],1)},staticRenderFns:[]},void 0,Kr,void 0,!1,void 0,!1,void 0,void 0,void 0);let Xr=class extends i.default{};Tr([_n()],Xr.prototype,"vssue",void 0),Xr=Tr([xn.b],Xr);const to=Br({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vssue-header"},[n("a",{staticClass:"vssue-header-comments-count",attrs:{href:t.vssue.issue?t.vssue.issue.link:null,target:"_blank",rel:"noopener noreferrer"}},[n("span",[t._v("\n "+t._s(t.vssue.comments?t.vssue.$tc("comments",t.vssue.comments.count,{count:t.vssue.comments.count}):t.vssue.$tc("comments",0))+"\n ")])]),t._v(" "),n("span",{staticClass:"vssue-header-powered-by"},[n("span",[t._v("Powered by")]),t._v(" "),t.vssue.API?n("span",[n("a",{attrs:{href:t.vssue.API.platform.link,title:t.vssue.API.platform.name+" API "+t.vssue.API.platform.version,target:"_blank",rel:"noopener noreferrer"}},[t._v("\n "+t._s(t.vssue.API.platform.name)+"\n ")]),t._v(" "),n("span",[t._v("&")])]):t._e(),t._v(" "),n("a",{attrs:{href:"https://github.com/meteorlxy/vssue",title:"Vssue v"+t.vssue.version,target:"_blank",rel:"noopener noreferrer"}},[t._v("\n Vssue\n ")])])])},staticRenderFns:[]},void 0,Xr,void 0,!1,void 0,!1,void 0,void 0,void 0),eo={login:"Login with {platform}",logout:"Logout",currentUser:"Current User",loading:"Loading",submit:"Submit",submitting:"Submitting",submitComment:"Submit Comment",cancel:"Cancel",edit:"Edit",editMode:"Edit Mode",delete:"Delete",reply:"Reply",heart:"Heart",like:"Like",unlike:"Unlike",perPage:"Comments per page",sort:"Click to change the sort direction",page:"Page",prev:"Previous Page",next:"Next Page",comments:"Comments | {count} Comment | {count} Comments",loginToComment:"Login with {platform} account to leave a comment",placeholder:"Leave a comment. Styling with Markdown is supported. Ctrl + Enter to submit.",noLoginPlaceHolder:"Login to leave a comment. Styling with Markdown is supported. ",failed:"Failed to load comments",initializing:"Initializing...",issueNotCreated:"Click to create issue",loadingComments:"Loading comments...",loginRequired:"Login to view comments",noComments:"No comments yet. Leave the first comment !",reactionGiven:"Already given '{reaction}' reaction",deleteConfirm:"Confirm to delete this comment ?",deleteFailed:"Failed to delete comment"},no={login:"使用 {platform} 登录",logout:"退出登录",currentUser:"当前用户",loading:"加载中",submit:"提交",submitting:"发表中",submitComment:"发表评论",cancel:"取消",edit:"编辑",editMode:"编辑模式",delete:"删除",reply:"回复",heart:"喜欢",like:"赞",unlike:"踩",perPage:"每页评论数",sort:"点击改变排序方式",page:"页数",prev:"上一页",next:"下一页",comments:"评论 | {count} 条评论 | {count} 条评论",loginToComment:"使用 {platform} 帐号登录后发表评论",placeholder:"留下你的评论丨支持 Markdown 语法丨Ctrl + Enter 发表评论",noLoginPlaceHolder:"登录后才能发表评论丨支持 Markdown 语法",failed:"评论加载失败",initializing:"正在初始化...",issueNotCreated:"点击创建 Issue",loadingComments:"正在加载评论...",loginRequired:"登录后查看评论",noComments:"还没有评论,来发表第一条评论吧!",reactionGiven:"已经添加过 '{reaction}' 了",deleteConfirm:"确认要删除该评论吗?",deleteFailed:"评论删除失败"},ro={login:"Entrar com {platform}",logout:"Sair",currentUser:"Usuário Atual",loading:"Carregando",submit:"Enviar",submitting:"Enviando",submitComment:"Enviar Comentário",cancel:"Cancelar",edit:"Editar",editMode:"Modo de Edição",delete:"Apagar",reply:"Responder",heart:"Heart",like:"Like",unlike:"Unlike",perPage:"Comentários por página",sort:"Clique para alterar a ordenação",page:"Página",prev:"Página Anterior",next:"Próxima Página",comments:"Comentários | {count} Comentário | {count} Comentários",loginToComment:"Entre com uma conta {platform} para deixar um comentário",placeholder:"Deixe um comentário. Estilos com Markdown suportados. Ctrl + Enter para enviar.",noLoginPlaceHolder:"Entre para deixar um comentário. Estilos com Markdown suportados. ",failed:"Falha ao carregar comentários",initializing:"Inicializando...",issueNotCreated:"Click to create issue",loadingComments:"Carregando comentários...",loginRequired:"Entrar para visualizar comentários",noComments:"Nenhum comentário. Deixe o primeiro comentário!",reactionGiven:"Já reagiu com '{reaction}'",deleteConfirm:"Apagar este comentário?",deleteFailed:"Falha ao apagar comentário"},oo={login:"{platform} でログイン",logout:"ログアウト",currentUser:"現在のユーザー",loading:"読み込み中",submit:"送信",submitting:"送信中",submitComment:"コメントを送信",cancel:"キャンセル",edit:"編集",editMode:"編集モード",delete:"削除",reply:"返信",heart:"ハート",like:"高評価",unlike:"低評価",perPage:"コメント/ページ",sort:"並び順を変更するにはクリックしてください",page:"ページ",prev:"前のページ",next:"次のページ",comments:"コメント | {count} コメント | {count} コメント",loginToComment:"コメントを残すには {platform} アカウントでログインしてください。",placeholder:"コメントを残してください。Markdown 記法をサポートしています。 Ctrl + Enter で送信できます。",noLoginPlaceHolder:"コメントを残すにはログインしてください。マークダウン記法をサポートしています。",failed:"コメントの読み込みに失敗しました",initializing:"初期化中...",issueNotCreated:"Click to create issue",loadingComments:"コメントの読み込み中...",loginRequired:"コメントを見るにはログインしてください",noComments:"まだコメントがありません。最初のコメントを残しましょう!",reactionGiven:"既に '{reaction}' のリアクションをしています",deleteConfirm:"本当にコメントを削除してもいいですか?",deleteFailed:"コメントの削除に失敗しました"},io={login:"התחברו עם {platform}",logout:"התנתקו",currentUser:"משתמש/ת נוכחי/ת",loading:"טוען",submit:"שליחה",submitting:"שולח",submitComment:"שליחת תגובה",cancel:"ביטל",edit:"עריכה",editMode:"מצב עריכה",delete:"מחיקה",reply:"תשובה",heart:"לב",like:"לייק",unlike:"אנלייק",perPage:"תגובות לדף",sort:"לחצו כדי לשנות את כיוון המיון",page:"דף",prev:"הדף הקודם",next:"הדף הבא",comments:"תגובות | {count} תגובה | {count} תגובות",loginToComment:"התחברו עם חשבון {platform} כדי להשאיר תגובה",placeholder:"השאירו תגובה. יש תמיכה בעיצוב בעזרת Markdown. Ctrl + Enter כדי לשלוח.",noLoginPlaceHolder:"התחברו כדי להשאיר תגובה. יש תמיכה בעיצוב בעזרת Markdown. ",failed:"כשלון בטעינת התגובות",initializing:"מאתחל...",issueNotCreated:"לחצו ליצירת issue",loadingComments:"טוען תגובות...",loginRequired:"התחברו כדי לצפות בתגובות",noComments:"עדיין אין תגובות. השאירו תגובה ראשונה !",reactionGiven:"כבר ניתן חיווי '{reaction}'",deleteConfirm:"בטוחים במחיקת התגובה ?",deleteFailed:"כשלון במחיקת התגובה"};Object.prototype.hasOwnProperty.call(i.default,"$i18n")||i.default.use(jr);const ao=new jr({locale:"en",fallbackLocale:"en",messages:{en:eo,"en-US":eo,zh:no,"zh-CN":no,pt:ro,"pt-BR":ro,ja:oo,"ja-JP":oo,he:io,"he-IL":io}});let so=class extends i.default{constructor(){super(...arguments),this.title=t=>`${t.prefix}${document.title}`,this.issueId=null,this.options=null,this.API=null,this.accessToken=null,this.user=null,this.issue=null,this.comments=null,this.query={page:1,perPage:10,sort:"desc"},this.isInitializing=!0,this.isIssueNotCreated=!1,this.isLoginRequired=!1,this.isFailed=!1,this.isCreatingIssue=!1,this.isLoadingComments=!1,this.isCreatingComment=!1,this.isUpdatingComment=!1}get version(){return"1.4.8"}get issueTitle(){return null===this.options?"":"function"==typeof this.title?this.title(this.options):`${this.options.prefix}${this.title}`}get isPending(){return this.isLoadingComments||this.isCreatingComment||this.isUpdatingComment}get isLogined(){return null!==this.accessToken&&null!==this.user}get isAdmin(){return null!==this.options&&null!==this.accessToken&&null!==this.user&&(this.user.username===this.options.owner||this.options.admins.includes(this.user.username))}get accessTokenKey(){return this.API?`Vssue.${this.API.platform.name.toLowerCase()}.access_token`:""}onQueryPerPageChange(){this.query.page=1,this.getComments()}onQueryChange(){this.getComments()}setOptions(t){this.options=Object.assign({labels:["Vssue"],state:"Vssue",prefix:"[Vssue]",admins:[],perPage:10,proxy:t=>"https://cors-anywhere.azm.workers.dev/"+t,issueContent:({url:t})=>t,autoCreateIssue:!1},t);const e=["api","owner","repo","clientId"];for(const t of e)this.options[t]||console.warn(`[Vssue] the option '${t}' is required`);if(this.options.locale)this.$i18n.locale=this.options.locale;else{const t=Object.keys(this.$i18n.messages),e=window.navigator.languages;this.$i18n.locale=e.filter(e=>t.includes(e)).shift()||"en"}}async init(){try{await this.initStore(),await this.initComments()}catch(t){t.response&&[401,403].includes(t.response.status)?this.isLoginRequired=!0:this.isFailed=!0,console.error(t)}}async initStore(){try{if(!this.options)throw new Error("Options are required to initialize Vssue");this.API=null,this.accessToken=null,this.user=null,this.issue=null,this.comments=null,this.query={page:1,perPage:this.options.perPage,sort:"desc"},this.isInitializing=!0,this.isIssueNotCreated=!1,this.isLoginRequired=!1,this.isFailed=!1,this.isCreatingIssue=!1,this.isLoadingComments=!1,this.isCreatingComment=!1,this.isUpdatingComment=!1;const t=this.options.api;this.API=new t({baseURL:this.options.baseURL,labels:this.options.labels,state:this.options.state,owner:this.options.owner,repo:this.options.repo,clientId:this.options.clientId,clientSecret:this.options.clientSecret,proxy:this.options.proxy}),await this.handleAuth()}finally{this.isInitializing=!1}}async initComments(){if(this.API&&this.options)if(this.issueId){const[t,e]=await Promise.all([this.API.getIssue({accessToken:this.accessToken,issueId:this.issueId}),this.API.getComments({accessToken:this.accessToken,issueId:this.issueId,query:this.query})]);this.issue=t,this.comments=e}else this.issue=await this.API.getIssue({accessToken:this.accessToken,issueTitle:this.issueTitle}),null===this.issue?(this.isIssueNotCreated=!0,this.options.autoCreateIssue&&await this.postIssue()):await this.getComments()}async postIssue(){if(this.API&&this.options&&!this.issue&&!this.issueId&&(this.isLogined||this.login(),this.isAdmin))try{this.isCreatingIssue=!0;const t=await this.API.postIssue({title:this.issueTitle,content:await this.options.issueContent({options:this.options,url:In(window.location.href)}),accessToken:this.accessToken});this.issue=t,this.isIssueNotCreated=!1,await this.getComments()}catch(t){this.isFailed=!0}finally{this.isCreatingIssue=!1}}async getComments(){try{if(!this.API||!this.issue||this.isLoadingComments)return;this.isLoadingComments=!0;const t=await this.API.getComments({accessToken:this.accessToken,issueId:this.issue.id,query:this.query});return this.comments=t,this.query.page!==t.page&&(this.query.page=t.page),this.query.perPage!==t.perPage&&(this.query.perPage=t.perPage),t}catch(t){if(!t.response||![401,403].includes(t.response.status)||this.isLogined)throw this.$emit("error",t),t;this.isLoginRequired=!0}finally{this.isLoadingComments=!1}}async postComment({content:t}){try{if(!this.API||!this.issue||this.isCreatingComment)return;this.isCreatingComment=!0;return await this.API.postComment({accessToken:this.accessToken,content:t,issueId:this.issue.id})}catch(t){throw this.$emit("error",t),t}finally{this.isCreatingComment=!1}}async putComment({commentId:t,content:e}){try{if(!this.API||!this.issue)return;return await this.API.putComment({accessToken:this.accessToken,issueId:this.issue.id,commentId:t,content:e})}catch(t){throw this.$emit("error",t),t}}async deleteComment({commentId:t}){try{if(!this.API||!this.issue)return;return await this.API.deleteComment({accessToken:this.accessToken,issueId:this.issue.id,commentId:t})}catch(t){throw this.$emit("error",t),t}}async getCommentReactions({commentId:t}){try{if(!this.API||!this.issue)return;return await this.API.getCommentReactions({accessToken:this.accessToken,issueId:this.issue.id,commentId:t})}catch(t){throw this.$emit("error",t),t}}async postCommentReaction({commentId:t,reaction:e}){try{if(!this.API||!this.issue)return!1;return await this.API.postCommentReaction({accessToken:this.accessToken,issueId:this.issue.id,commentId:t,reaction:e})}catch(t){throw this.$emit("error",t),t}}login(){this.API&&this.API.redirectAuth()}logout(){this.setAccessToken(null),this.user=null}async handleAuth(){if(!this.API)return;const t=await this.API.handleAuth();t?(this.setAccessToken(t),this.user=await this.API.getUser({accessToken:t})):this.getAccessToken()?this.user=await this.API.getUser({accessToken:this.accessToken}):(this.setAccessToken(null),this.user=null)}getAccessToken(){return this.accessToken=window.localStorage.getItem(this.accessTokenKey),this.accessToken}setAccessToken(t){null===t?window.localStorage.removeItem(this.accessTokenKey):window.localStorage.setItem(this.accessTokenKey,t),this.accessToken=t}};Tr([On("query.perPage")],so.prototype,"onQueryPerPageChange",null),Tr([On("query.page"),On("query.sort")],so.prototype,"onQueryChange",null),so=Tr([Object(xn.b)({i18n:ao})],so);var uo=so;let co=class extends i.default{constructor(){super(...arguments),this.vssue=new uo}onOptionsChange(t){this.vssue.setOptions(t)}mounted(){null!==this.title&&(this.vssue.title=this.title),null!==this.issueId&&(this.vssue.issueId=this.issueId),this.vssue.setOptions(this.options),this.vssue.init()}};var lo;Tr([Dn({type:[String,Function],required:!1,default:null})],co.prototype,"title",void 0),Tr([Dn({type:[String,Number],required:!1,default:null})],co.prototype,"issueId",void 0),Tr([Dn({type:Object,required:!1,default:()=>({})})],co.prototype,"options",void 0),Tr([(lo="vssue",Object(xn.a)((function(t,e){var n=t.provide;An(n)&&(n=t.provide=En(n)),n.managed[e]=lo||e})))],co.prototype,"vssue",void 0),Tr([On("options",{deep:!0})],co.prototype,"onOptionsChange",null),co=Tr([Object(xn.b)({components:{Iconfont:Fr,VssueBody:Zr,VssueHeader:to}})],co);const fo=Br({render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"vssue"},[e("Iconfont"),this._v(" "),e("VssueHeader"),this._v(" "),e("VssueBody")],1)},staticRenderFns:[]},void 0,co,void 0,!1,void 0,!1,void 0,void 0,void 0);var po=n(24),ho=n.n(po);function vo(t){return{username:t.login,avatar:t.avatar_url,homepage:t.html_url}}function mo(t){return{id:t.number,title:t.title,content:t.body,link:t.html_url}}function go(t){return{like:t["+1"],unlike:t[-1],heart:t.heart}}function yo(t){return{id:t.id,content:t.body_html,contentRaw:t.body,author:vo(t.user),createdAt:t.created_at,updatedAt:t.updated_at,reactions:go(t.reactions)}}function bo(t){return"like"===t?"+1":"unlike"===t?"-1":t}class wo{constructor({baseURL:t="https://github.com",owner:e,repo:n,labels:r,clientId:o,clientSecret:i,state:a,proxy:s}){if(void 0===i||void 0===s)throw new Error("clientSecret and proxy is required for GitHub V3");this.baseURL=t,this.owner=e,this.repo=n,this.labels=r,this.clientId=o,this.clientSecret=i,this.state=a,this.proxy=s,this.$http=ho.a.create({baseURL:"https://github.com"===t?"https://api.github.com":Tn(t,"api/v3"),headers:{Accept:"application/vnd.github.v3+json"}}),this.$http.interceptors.response.use(t=>t.data&&t.data.error?Promise.reject(new Error(t.data.error_description)):t,t=>(void 0===t.response&&"Network Error"===t.message&&(t.response={status:403}),Promise.reject(t)))}get platform(){return{name:"GitHub",link:this.baseURL,version:"v3",meta:{reactable:!0,sortable:!1}}}redirectAuth(){window.location.href=jn(Tn(this.baseURL,"login/oauth/authorize"),{client_id:this.clientId,redirect_uri:window.location.href,scope:"public_repo",state:this.state})}async handleAuth(){const t=Mn(window.location.search);if(t.code){if(t.state!==this.state)return null;const e=t.code;delete t.code,delete t.state;const n=jn(In(window.location.href),t)+window.location.hash;window.history.replaceState(null,"",n);return await this.getAccessToken({code:e})}return null}async getAccessToken({code:t}){const e=Tn(this.baseURL,"login/oauth/access_token"),n="function"==typeof this.proxy?this.proxy(e):this.proxy,{data:r}=await this.$http.post(n,{client_id:this.clientId,client_secret:this.clientSecret,code:t},{headers:{Accept:"application/json"}});return r.access_token}async getUser({accessToken:t}){const{data:e}=await this.$http.get("user",{headers:{Authorization:"token "+t}});return vo(e)}async getIssue({accessToken:t,issueId:e,issueTitle:n}){const r={};if(t&&(r.headers={Authorization:"token "+t}),!e){r.params={q:[`"${n}"`,"is:issue","in:title",`repo:${this.owner}/${this.repo}`,"is:public",...this.labels.map(t=>"label:"+t)].join(" "),timestamp:Date.now()};const{data:t}=await this.$http.get("search/issues",r);return t.items.map(mo).find(t=>t.title===n)||null}try{r.params={timestamp:Date.now()};const{data:t}=await this.$http.get(`repos/${this.owner}/${this.repo}/issues/${e}`,r);return mo(t)}catch(t){if(t.response&&404===t.response.status)return null;throw t}}async postIssue({accessToken:t,title:e,content:n}){const{data:r}=await this.$http.post(`repos/${this.owner}/${this.repo}/issues`,{title:e,body:n,labels:this.labels},{headers:{Authorization:"token "+t}});return mo(r)}async getComments({accessToken:t,issueId:e,query:{page:n=1,perPage:r=10}={}}){const o={params:{timestamp:Date.now()}},i={params:{page:n,per_page:r,timestamp:Date.now()},headers:{Accept:["application/vnd.github.v3.raw+json","application/vnd.github.v3.html+json","application/vnd.github.squirrel-girl-preview"]}};t&&(o.headers={Authorization:"token "+t},i.headers.Authorization="token "+t);const[a,s]=await Promise.all([this.$http.get(`repos/${this.owner}/${this.repo}/issues/${e}`,o),this.$http.get(`repos/${this.owner}/${this.repo}/issues/${e}/comments`,i)]),u=s.headers.link||null,c=/rel="next"/.test(u)?Number(u.replace(/^.*[^_]page=(\d*).*rel="next".*$/,"$1"))-1:/rel="prev"/.test(u)?Number(u.replace(/^.*[^_]page=(\d*).*rel="prev".*$/,"$1"))+1:1,l=u?Number(u.replace(/^.*per_page=(\d*).*$/,"$1")):r;return{count:Number(a.data.comments),page:c,perPage:l,data:s.data.map(yo)}}async postComment({accessToken:t,issueId:e,content:n}){const{data:r}=await this.$http.post(`repos/${this.owner}/${this.repo}/issues/${e}/comments`,{body:n},{headers:{Authorization:"token "+t,Accept:["application/vnd.github.v3.raw+json","application/vnd.github.v3.html+json","application/vnd.github.squirrel-girl-preview"]}});return yo(r)}async putComment({accessToken:t,commentId:e,content:n}){const{data:r}=await this.$http.patch(`repos/${this.owner}/${this.repo}/issues/comments/${e}`,{body:n},{headers:{Authorization:"token "+t,Accept:["application/vnd.github.v3.raw+json","application/vnd.github.v3.html+json","application/vnd.github.squirrel-girl-preview"]}});return yo(r)}async deleteComment({accessToken:t,commentId:e}){const{status:n}=await this.$http.delete(`repos/${this.owner}/${this.repo}/issues/comments/${e}`,{headers:{Authorization:"token "+t}});return 204===n}async getCommentReactions({accessToken:t,commentId:e}){const{data:n}=await this.$http.get(`repos/${this.owner}/${this.repo}/issues/comments/${e}`,{params:{timestamp:Date.now()},headers:{Authorization:"token "+t,Accept:"application/vnd.github.squirrel-girl-preview"}});return go(n.reactions)}async postCommentReaction({accessToken:t,commentId:e,reaction:n}){const r=await this.$http.post(`repos/${this.owner}/${this.repo}/issues/comments/${e}/reactions`,{content:bo(n)},{headers:{Authorization:"token "+t,Accept:"application/vnd.github.squirrel-girl-preview"}});return 200===r.status?this.deleteCommentReaction({accessToken:t,commentId:e,reactionId:r.data.id}):201===r.status}async deleteCommentReaction({accessToken:t,commentId:e,reactionId:n}){return 204===(await this.$http.delete(`repos/${this.owner}/${this.repo}/issues/comments/${e}/reactions/${n}`,{headers:{Authorization:"token "+t,Accept:"application/vnd.github.squirrel-girl-preview"}})).status}}function xo(t){return null===t?{username:"ghost",avatar:"https://avatars3.githubusercontent.com/u/10137?v=4",homepage:"https://github.com/ghost"}:{username:t.login,avatar:t.avatarUrl,homepage:t.url}}function _o(t){return{id:t.number,title:t.title,content:t.body,link:t.url}}function Eo(t){return{like:t.find(t=>"THUMBS_UP"===t.content).users.totalCount,unlike:t.find(t=>"THUMBS_DOWN"===t.content).users.totalCount,heart:t.find(t=>"HEART"===t.content).users.totalCount}}function Ao(t){return{id:t.id,content:t.bodyHTML,contentRaw:t.body,author:xo(t.author),createdAt:t.createdAt,updatedAt:t.updatedAt,reactions:Eo(t.reactionGroups)}}function ko(t){return"like"===t?"THUMBS_UP":"unlike"===t?"THUMBS_DOWN":"heart"===t?"HEART":t}class Co{constructor({baseURL:t="https://github.com",owner:e,repo:n,labels:r,clientId:o,clientSecret:i,state:a,proxy:s}){if(void 0===i||void 0===s)throw new Error("clientSecret and proxy is required for GitHub V4");this.baseURL=t,this.owner=e,this.repo=n,this.labels=r,this.clientId=o,this.clientSecret=i,this.state=a,this.proxy=s,this._pageInfo={page:1,startCursor:null,endCursor:null,sort:null,perPage:null},this._issueNodeId=null,this.$http=ho.a.create({baseURL:"https://github.com"===t?"https://api.github.com":Tn(t,"api"),headers:{Accept:"application/vnd.github.v3+json"}}),this.$http.interceptors.response.use(t=>t.data.error?Promise.reject(t.data.error_description):t.data.errors?Promise.reject(t.data.errors[0].message):t)}get platform(){return{name:"GitHub",link:this.baseURL,version:"v4",meta:{reactable:!0,sortable:!0}}}redirectAuth(){window.location.href=jn(Tn(this.baseURL,"login/oauth/authorize"),{client_id:this.clientId,redirect_uri:window.location.href,scope:"public_repo",state:this.state})}async handleAuth(){const t=Mn(window.location.search);if(t.code){if(t.state!==this.state)return null;const e=t.code;delete t.code,delete t.state;const n=jn(In(window.location.href),t)+window.location.hash;window.history.replaceState(null,"",n);return await this.getAccessToken({code:e})}return null}async getAccessToken({code:t}){const e=Tn(this.baseURL,"login/oauth/access_token"),n="function"==typeof this.proxy?this.proxy(e):this.proxy,{data:r}=await this.$http.post(n,{client_id:this.clientId,client_secret:this.clientSecret,code:t},{headers:{Accept:"application/json"}});return r.access_token}async getUser({accessToken:t}){const{data:e}=await this.$http.post("graphql",{query:"query getUser {\n viewer {\n login\n avatarUrl\n url\n }\n}"},{headers:{Authorization:"token "+t}});return xo(e.data.viewer)}async getIssue({accessToken:t,issueId:e,issueTitle:n}){const r={};if(t&&(r.headers={Authorization:"token "+t}),!e){const t=[`"${n}"`,"in:title",`repo:${this.owner}/${this.repo}`,"is:public",...this.labels.map(t=>"label:"+t)].join(" "),{data:e}=await this.$http.post("graphql",{variables:{query:t},query:"query getIssueByTitle(\n $query: String!\n) {\n search(\n query: $query\n type: ISSUE\n first: 20\n ) {\n nodes {\n ... on Issue {\n id\n number\n title\n body\n url\n }\n }\n }\n}"},r),o=e.data.search.nodes.find(t=>t.title===n);return o?(this._issueNodeId=o.id,_o(o)):null}try{const{data:t}=await this.$http.post("graphql",{query:`query getIssueById {\n repository(owner: "${this.owner}", name: "${this.repo}") {\n issue (number: ${e}) {\n id\n number\n title\n body\n url\n }\n }\n}`},r);return this._issueNodeId=t.data.repository.issue.id,_o(t.data.repository.issue)}catch(t){if(t.response&&404===t.response.status)return null;throw t}}async postIssue({accessToken:t,title:e,content:n}){const{data:r}=await this.$http.post(`repos/${this.owner}/${this.repo}/issues`,{title:e,body:n,labels:this.labels},{headers:{Authorization:"token "+t}});return r.url=r.html_url,this._issueNodeId=r.node_id,_o(r)}async getComments({accessToken:t,issueId:e,query:{page:n=1,perPage:r=10,sort:o="desc"}={}}){const i={};t&&(i.headers={Authorization:"token "+t}),null!==this._pageInfo.sort&&o!==this._pageInfo.sort&&(n=1);const{firstOrLast:a,afterOrBefore:s,cursor:u}=this._getQueryParams({page:n,sort:o}),{data:c}=await this.$http.post("graphql",{variables:{owner:this.owner,repo:this.repo,issueId:e,perPage:r},query:`query getComments(\n $owner: String!\n $repo: String!\n $issueId: Int!\n $perPage: Int!\n) {\n repository(owner: $owner, name: $repo) {\n issue(number: $issueId) {\n comments(\n ${a}: $perPage\n ${null===s?"":`${s}: "${u}"`}\n ) {\n totalCount\n pageInfo {\n endCursor\n startCursor\n }\n nodes {\n id\n body\n bodyHTML\n createdAt\n updatedAt\n author {\n avatarUrl\n login\n url\n }\n reactionGroups {\n users (first: 0) {\n totalCount\n }\n content\n }\n }\n }\n }\n }\n}`},i),l=c.data.repository.issue.comments;return"desc"===o&&l.nodes.reverse(),this._pageInfo={page:n,startCursor:l.pageInfo.startCursor,endCursor:l.pageInfo.endCursor,sort:o,perPage:r},{count:l.totalCount,page:n,perPage:r,data:l.nodes.map(Ao)}}async postComment({accessToken:t,content:e}){const{data:n}=await this.$http.post("graphql",{variables:{issueNodeId:this._issueNodeId,content:e},query:"mutation postComment(\n $issueNodeId: ID!\n $content: String!\n) {\n addComment(\n input: {\n subjectId: $issueNodeId\n body: $content\n }\n ) {\n commentEdge {\n node {\n id\n body\n bodyHTML\n createdAt\n updatedAt\n author {\n avatarUrl\n login\n url\n }\n reactionGroups {\n users (first: 0) {\n totalCount\n }\n content\n }\n }\n }\n }\n}"},{headers:{Authorization:"token "+t}});return Ao(n.data.addComment.commentEdge.node)}async putComment({accessToken:t,commentId:e,content:n}){const{data:r}=await this.$http.post("graphql",{variables:{commentId:e,content:n},query:"mutation putComment(\n $commentId: ID!,\n $content: String!,\n) {\n updateIssueComment(input: {\n id: $commentId\n body: $content\n }) {\n issueComment {\n id\n body\n bodyHTML\n createdAt\n updatedAt\n author {\n avatarUrl\n login\n url\n }\n reactionGroups {\n users (first: 0) {\n totalCount\n }\n content\n }\n }\n }\n}"},{headers:{Authorization:"token "+t}});return Ao(r.data.updateIssueComment.issueComment)}async deleteComment({accessToken:t,commentId:e}){return await this.$http.post("graphql",{variables:{commentId:e},query:"mutation deleteComment(\n $commentId: ID!,\n) {\n deleteIssueComment(input: {\n id: $commentId\n }) {\n clientMutationId\n }\n}"},{headers:{Authorization:"token "+t}}),!0}async getCommentReactions({accessToken:t,issueId:e,commentId:n}){const{firstOrLast:r,afterOrBefore:o,cursor:i}=this._getQueryParams(),{data:a}=await this.$http.post("graphql",{variables:{owner:this.owner,repo:this.repo,issueId:e,perPage:this._pageInfo.perPage},query:`query getComments(\n $owner: String!\n $repo: String!\n $issueId: Int!\n $perPage: Int!\n) {\n repository(owner: $owner, name: $repo) {\n issue(number: $issueId) {\n comments(\n ${r}: $perPage\n ${null===o?"":`${o}: "${i}"`}\n ) {\n nodes {\n id\n reactionGroups {\n users (first: 0) {\n totalCount\n }\n content\n }\n }\n }\n }\n }\n}`},{headers:{Authorization:"token "+t}});return Eo(a.data.repository.issue.comments.nodes.find(t=>t.id===n).reactionGroups)}async postCommentReaction({accessToken:t,commentId:e,reaction:n}){return await this.$http.post("graphql",{variables:{commentId:e,content:ko(n)},query:"mutation postCommentReaction(\n $commentId: ID!,\n $content: ReactionContent!,\n) {\n addReaction(input: {\n subjectId: $commentId\n content: $content\n }) {\n reaction {\n databaseId\n }\n }\n}"},{headers:{Authorization:"token "+t}}),!0}_getQueryParams({page:t=this._pageInfo.page,sort:e=this._pageInfo.sort}={}){let n,r,o;return 1===t?(n="asc"===e?"first":"last",r=null,o=null):"asc"===e?t>this._pageInfo.page?(n="first",r="after",o=this._pageInfo.endCursor):(n="last",r="before",o=this._pageInfo.startCursor):t>this._pageInfo.page?(n="last",r="before",o=this._pageInfo.startCursor):(n="first",r="after",o=this._pageInfo.endCursor),{firstOrLast:n,afterOrBefore:r,cursor:o}}}function Do(t){return{username:t.username,avatar:t.avatar_url,homepage:t.web_url}}function Oo(t){return{id:t.iid,title:t.title,content:t.description,link:t.web_url}}function So(t){return{id:t.id,content:t.body_html||"",contentRaw:t.body,author:Do(t.author),createdAt:t.created_at,updatedAt:t.updated_at,reactions:t.reactions}}function $o(t){return{like:t.filter(t=>"thumbsup"===t.name).length,unlike:t.filter(t=>"thumbsdown"===t.name).length,heart:t.filter(t=>"heart"===t.name).length}}function jo(t){return"like"===t?"thumbsup":"unlike"===t?"thumbsdown":t}class To{constructor({baseURL:t="https://gitlab.com",owner:e,repo:n,labels:r,clientId:o,state:i}){this.baseURL=t,this.owner=e,this.repo=n,this.labels=r,this.clientId=o,this.state=i,this._encodedRepo=encodeURIComponent(`${this.owner}/${this.repo}`),this.$http=ho.a.create({baseURL:Tn(t,"api/v4"),headers:{Accept:"application/json"}})}get platform(){return{name:"GitLab",link:this.baseURL,version:"v4",meta:{reactable:!0,sortable:!0}}}redirectAuth(){window.location.href=jn(Tn(this.baseURL,"oauth/authorize"),{client_id:this.clientId,redirect_uri:window.location.href,response_type:"token",state:this.state})}async handleAuth(){const t=Mn(window.location.hash.slice(1));if(!t.access_token||t.state!==this.state)return null;const e=t.access_token;delete t.access_token,delete t.token_type,delete t.expires_in,delete t.state;const n=$n(t),r=n?"#"+n:"",o=`${In(window.location.href)}${window.location.search}${r}`;return window.history.replaceState(null,"",o),e}async getUser({accessToken:t}){const{data:e}=await this.$http.get("user",{headers:{Authorization:"Bearer "+t}});return Do(e)}async getIssue({accessToken:t,issueId:e,issueTitle:n}){const r={};if(t&&(r.headers={Authorization:"Bearer "+t}),!e){r.params={labels:this.labels.join(","),order_by:"created_at",sort:"asc",search:n};const{data:t}=await this.$http.get(`projects/${this._encodedRepo}/issues`,r);return t.map(Oo).find(t=>t.title===n)||null}try{const{data:t}=await this.$http.get(`projects/${this._encodedRepo}/issues/${e}`,r);return Oo(t)}catch(t){if(t.response&&404===t.response.status)return null;throw t}}async postIssue({accessToken:t,title:e,content:n}){const{data:r}=await this.$http.post(`projects/${this._encodedRepo}/issues`,{title:e,description:n,labels:this.labels.join(",")},{headers:{Authorization:"Bearer "+t}});return Oo(r)}async getComments({accessToken:t,issueId:e,query:{page:n=1,perPage:r=10,sort:o="desc"}={}}){const i={params:{page:n,per_page:r,order_by:"created_at",sort:o}};t&&(i.headers={Authorization:"Bearer "+t});const a=await this.$http.get(`projects/${this._encodedRepo}/issues/${e}/notes`,i),s=a.data,u=[];for(const n of s)u.push((async()=>{n.body_html=await this.getMarkdownContent({accessToken:t,contentRaw:n.body})})()),u.push((async()=>{n.reactions=await this.getCommentReactions({accessToken:t,issueId:e,commentId:n.id})})());return await Promise.all(u),{count:Number(a.headers["x-total"]),page:Number(a.headers["x-page"]),perPage:Number(a.headers["x-per-page"]),data:s.map(So)}}async postComment({accessToken:t,issueId:e,content:n}){const{data:r}=await this.$http.post(`projects/${this._encodedRepo}/issues/${e}/notes`,{body:n},{headers:{Authorization:"Bearer "+t}});return So(r)}async putComment({accessToken:t,issueId:e,commentId:n,content:r}){const{data:o}=await this.$http.put(`projects/${this._encodedRepo}/issues/${e}/notes/${n}`,{body:r},{headers:{Authorization:"Bearer "+t}}),[i,a]=await Promise.all([this.getMarkdownContent({accessToken:t,contentRaw:o.body}),this.getCommentReactions({accessToken:t,issueId:e,commentId:o.id})]);return o.body_html=i,o.reactions=a,So(o)}async deleteComment({accessToken:t,issueId:e,commentId:n}){const{status:r}=await this.$http.delete(`projects/${this._encodedRepo}/issues/${e}/notes/${n}`,{headers:{Authorization:"Bearer "+t}});return 204===r}async getCommentReactions({accessToken:t,issueId:e,commentId:n}){const{data:r}=await this.$http.get(`projects/${this._encodedRepo}/issues/${e}/notes/${n}/award_emoji`,{headers:{Authorization:"Bearer "+t}});return $o(r)}async postCommentReaction({issueId:t,commentId:e,reaction:n,accessToken:r}){try{return 201===(await this.$http.post(`projects/${this._encodedRepo}/issues/${t}/notes/${e}/award_emoji`,{name:jo(n)},{headers:{Authorization:"Bearer "+r}})).status}catch(t){if(t.response&&404===t.response.status)return!1;throw t}}async getMarkdownContent({accessToken:t,contentRaw:e}){const n={};t&&(n.headers={Authorization:"Bearer "+t});const{data:r}=await this.$http.post("markdown",{text:e,gfm:!0},n);return r.html}}function Po(t){return{username:t.nickname,avatar:t.links.avatar.href,homepage:t.links.html.href}}function Bo(t){return{id:t.id,title:t.title,content:t.content.raw,link:t.links.html.href}}function Fo(t){return{id:t.id,content:t.content.html,contentRaw:t.content.raw,author:Po(t.user),createdAt:t.created_on,updatedAt:t.updated_on,reactions:null}}class Io{constructor({baseURL:t="https://bitbucket.org",owner:e,repo:n,clientId:r,state:o}){this.baseURL=t,this.owner=e,this.repo=n,this.clientId=r,this.state=o,this.$http=ho.a.create({baseURL:"https://api.bitbucket.org/2.0",headers:{Accept:"application/json"}})}get platform(){return{name:"Bitbucket",link:this.baseURL,version:"v2",meta:{reactable:!1,sortable:!0}}}redirectAuth(){window.location.href=jn(Tn(this.baseURL,"site/oauth2/authorize"),{client_id:this.clientId,redirect_uri:window.location.href,response_type:"token",state:this.state})}async handleAuth(){const t=Mn(window.location.hash.slice(1));if(!t.access_token||t.state!==this.state)return null;const e=t.access_token;delete t.access_token,delete t.token_type,delete t.expires_in,delete t.state,delete t.scopes;const n=$n(t),r=n?"#"+n:"",o=`${In(window.location.href)}${window.location.search}${r}`;return window.history.replaceState(null,"",o),e}async getUser({accessToken:t}){const{data:e}=await this.$http.get("user",{headers:{Authorization:"Bearer "+t}});return Po(e)}async getIssue({accessToken:t,issueId:e,issueTitle:n}){const r={};if(t&&(r.headers={Authorization:"Bearer "+t}),!e){r.params={sort:"created_on",q:`title="${n}"`,timestamp:Date.now()};const{data:t}=await this.$http.get(`repositories/${this.owner}/${this.repo}/issues`,r);return t.size>0?Bo(t.values[0]):null}try{r.params={timestamp:Date.now()};const{data:t}=await this.$http.get(`repositories/${this.owner}/${this.repo}/issues/${e}`,r);return Bo(t)}catch(t){if(t.response&&404===t.response.status)return null;throw t}}async postIssue({accessToken:t,title:e,content:n}){const{data:r}=await this.$http.post(`repositories/${this.owner}/${this.repo}/issues`,{title:e,content:{raw:n},priority:"trivial",kind:"task"},{headers:{Authorization:"Bearer "+t}});return r.links.html={href:Tn(this.baseURL,`${this.owner}/${this.repo}/issues/${r.id}`)},Bo(r)}async getComments({accessToken:t,issueId:e,query:{page:n=1,perPage:r=10,sort:o="desc"}={}}){const i={params:{page:n,pagelen:r,sort:"desc"===o?"-created_on":"created_on",timestamp:Date.now()}};t&&(i.headers={Authorization:"Bearer "+t});const{data:a}=await this.$http.get(`repositories/${this.owner}/${this.repo}/issues/${e}/comments`,i);return{count:a.size,page:a.page,perPage:a.pagelen,data:a.values.filter(t=>null!==t.content.raw).map(Fo)}}async postComment({accessToken:t,issueId:e,content:n}){const{data:r}=await this.$http.post(`repositories/${this.owner}/${this.repo}/issues/${e}/comments`,{content:{raw:n}},{headers:{Authorization:"Bearer "+t}});return Fo(r)}async putComment({accessToken:t,issueId:e,commentId:n,content:r}){const{data:o}=await this.$http.put(`repositories/${this.owner}/${this.repo}/issues/${e}/comments/${n}`,{content:{raw:r}},{headers:{Authorization:"Bearer "+t}});return Fo(o)}async deleteComment({accessToken:t,issueId:e,commentId:n}){const{status:r}=await this.$http.delete(`repositories/${this.owner}/${this.repo}/issues/${e}/comments/${n}`,{headers:{Authorization:"Bearer "+t}});return 204===r}async getCommentReactions(t){throw new Error("501 Not Implemented")}async postCommentReaction(t){throw new Error("501 Not Implemented")}}function Mo(t){return{username:t.login,avatar:t.avatar_url,homepage:t.html_url}}function Ro(t){return{id:t.number,title:t.title,content:t.body,link:t.html_url}}function Lo(t){return{id:t.id,content:t.body_html||"",contentRaw:t.body,author:Mo(t.user),createdAt:t.created_at,updatedAt:t.updated_at||"",reactions:null}}class zo{constructor({baseURL:t="https://gitee.com",owner:e,repo:n,labels:r,clientId:o,clientSecret:i,state:a,proxy:s}){if(void 0===i||void 0===s)throw new Error("clientSecret and proxy is required for Gitee V5");this.baseURL=t,this.owner=e,this.repo=n,this.labels=r,this.clientId=o,this.clientSecret=i,this.state=a,this.proxy=s,this.$http=ho.a.create({baseURL:Tn(t,"api/v5")}),this.$http.interceptors.response.use(t=>t,t=>(t.response.data&&t.response.data.message&&(t.message=t.response.data.message),Promise.reject(t)))}get platform(){return{name:"Gitee",link:this.baseURL,version:"v5",meta:{reactable:!1,sortable:!1}}}redirectAuth(){window.location.href=jn(Tn(this.baseURL,"oauth/authorize"),{client_id:this.clientId,redirect_uri:window.location.href,scope:"user_info issues notes",response_type:"code",state:this.state})}async handleAuth(){const t=Mn(window.location.search);if(t.code){if(t.state!==this.state)return null;const e=t.code;delete t.code,delete t.state;const n=jn(In(window.location.href),t)+window.location.hash;window.history.replaceState(null,"",n);return await this.getAccessToken({code:e})}return null}async getAccessToken({code:t}){const e=Tn(this.baseURL,"oauth/token"),n="function"==typeof this.proxy?this.proxy(e):this.proxy,{data:r}=await this.$http.post(n,{client_id:this.clientId,client_secret:this.clientSecret,code:t,grant_type:"authorization_code",redirect_uri:window.location.href});return r.access_token}async getUser({accessToken:t}){const{data:e}=await this.$http.get("user",{params:{access_token:t}});return Mo(e)}async getIssue({accessToken:t,issueId:e,issueTitle:n}){const r={params:{timestamp:Date.now()}};if(t&&(r.params.access_token=t),!e){Object.assign(r.params,{q:n,repo:`${this.owner}/${this.repo}`,per_page:1});const{data:t}=await this.$http.get("search/issues",r);return t.map(Ro).find(t=>t.title===n)||null}try{const{data:t}=await this.$http.get(`repos/${this.owner}/${this.repo}/issues/${e}`,r);return Ro(t)}catch(t){if(t.response&&404===t.response.status)return null;throw t}}async postIssue({accessToken:t,title:e,content:n}){const{data:r}=await this.$http.post(`repos/${this.owner}/issues`,{access_token:t,repo:this.repo,title:e,body:n,labels:this.labels.join(",")});return Ro(r)}async getComments({accessToken:t,issueId:e,query:{page:n=1,perPage:r=10}={}}){const o={params:{page:n,per_page:r,timestamp:Date.now()},headers:{Accept:["application/vnd.gitee.html+json"]}};t&&(o.params.access_token=t);const i=await this.$http.get(`repos/${this.owner}/${this.repo}/issues/${e}/comments`,o);return{count:Number(i.headers.total_count),page:n,perPage:r,data:i.data.map(Lo)}}async postComment({accessToken:t,issueId:e,content:n}){const{data:r}=await this.$http.post(`repos/${this.owner}/${this.repo}/issues/${e}/comments`,{body:n,access_token:t},{headers:{Accept:["application/vnd.gitee.html+json"]}});return Lo(r)}async putComment({accessToken:t,commentId:e,content:n}){const{data:r}=await this.$http.patch(`repos/${this.owner}/${this.repo}/issues/comments/${e}`,{body:n,access_token:t},{headers:{Accept:["application/vnd.gitee.html+json"]}});return Lo(r)}async deleteComment({accessToken:t,commentId:e}){const{status:n}=await this.$http.delete(`repos/${this.owner}/${this.repo}/issues/comments/${e}`,{params:{access_token:t}});return 204===n}async getCommentReactions(t){throw new Error("501 Not Implemented")}async postCommentReaction(t){throw new Error("501 Not Implemented")}}n(415);var No={name:"Vssue",components:{VssueComponent:fo},props:{options:{type:Object,default:function(){return{}}}},data:function(){return{key:"key",platformOptions:{github:wo,"github-v4":Co,gitlab:To,bitbucket:Io,gitee:zo}}},computed:{vssueOptions:function(){var t=this.platformOptions,e=this.options,n=t[e.platform];return Object(Xe.a)(Object(Xe.a)({},e),{},{api:n})}},watch:{$route:function(t,e){var n=this;t.path!==e.path&&setTimeout((function(){n.key="reco-".concat((new Date).getTime())}),300)}}},Uo=(n(416),{components:{Valine:wn,Vssue:Object(We.a)(No,(function(){var t=this.$createElement;return(this._self._c||t)("VssueComponent",{key:this.key,staticClass:"vssue-wrapper",attrs:{options:this.vssueOptions}})}),[],!1,null,null,null).exports},props:{isShowComments:{type:Boolean,default:!0}},data:function(){return{commentsOptions:{}}},computed:{solution:function(){var t=this.commentsOptions.solution,e=this.$themeConfig,n=e.valineConfig,r=e.vssueConfig,o=this.$themeLocaleConfig,i=o.valineConfig,a=o.vssueConfig,s="";return void 0!==t?s=t:void 0!==i||void 0!==n?s="valine":void 0===a&&void 0===r||(s="vssue"),s},options:function(){var t=this.commentsOptions.options,e=this.$themeConfig,n=e.valineConfig,r=e.vssueConfig,o=this.$themeLocaleConfig,i=o.valineConfig,a=o.vssueConfig;return void 0!==t?t:void 0!==i||void 0!==n?i||n:void 0!==a||void 0!==r?a||r:null},componentName:function(){var t=this.solution;return"valine"===t?"Valine":"vssue"===t?"Vssue":""}},mounted:function(){this.$themeConfig.commentsSolution=this.solution}}),Vo=Object(We.a)(Uo,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{directives:[{name:"show",rawName:"v-show",value:this.isShowComments,expression:"isShowComments"}],staticClass:"comments-wrapper"},[e("ClientOnly",[e(this.componentName,{tag:"component",attrs:{options:this.options}})],1)],1)}),[],!1,null,null,null).exports,Ho={props:{idVal:String,numStyle:Object,flagTitle:{type:String,default:"Your Article Title"}},methods:{getIdVal:function(t){var e=this.$site.base;return e.slice(0,e.length-1)+t}}},qo=Object(We.a)(Ho,(function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"leancloud-visitors",attrs:{id:this.getIdVal(this.idVal),"data-flag-title":this.flagTitle}},[e("a",{staticClass:"leancloud-visitors-count",style:this.numStyle})])}),[],!1,null,null,null).exports,Wo=(n(417),n(65)),Jo=n(19),Go=n(28),Qo={tags:{Hooks:{key:"Hooks",scope:"tags",path:"/tag/Hooks/",pageKeys:["v-7be18cec"]},JavaScript:{key:"JavaScript",scope:"tags",path:"/tag/JavaScript/",pageKeys:["v-eb0a8c32","v-eb5372d0","v-5c1fbe8d","v-551a8cd8","v-ff3b8a30","v-17b76e9b","v-0ab47119"]},Other:{key:"Other",scope:"tags",path:"/tag/Other/",pageKeys:["v-4783b3f0","v-5cc1e664","v-26b769fc","v-76590885","v-7684b546","v-4eca38af","v-0fd8cde4","v-e830f74c","v-82652b4c","v-4bda0223","v-380bd262","v-a1de2e8a","v-7ccfe036"]},vue:{key:"vue",scope:"tags",path:"/tag/vue/",pageKeys:["v-2bb1834f","v-29e093d1","v-25bbaa78"]}},categories:{Hooks:{key:"Hooks",scope:"categories",path:"/categories/Hooks/",pageKeys:["v-7be18cec"]},JavaScript:{key:"JavaScript",scope:"categories",path:"/categories/JavaScript/",pageKeys:["v-eb0a8c32","v-eb5372d0","v-5c1fbe8d","v-551a8cd8","v-ff3b8a30","v-17b76e9b","v-0ab47119"]},Other:{key:"Other",scope:"categories",path:"/categories/Other/",pageKeys:["v-4783b3f0","v-5cc1e664","v-26b769fc","v-76590885","v-7684b546","v-4eca38af","v-0fd8cde4","v-e830f74c","v-82652b4c","v-4bda0223","v-380bd262","v-a1de2e8a","v-7ccfe036"]},Vue:{key:"Vue",scope:"categories",path:"/categories/Vue/",pageKeys:["v-2bb1834f","v-29e093d1","v-25bbaa78"]}},timeline:{}},Yo=function(){function t(e,n){var r=this;Object(Jo.a)(this,t),this._metaMap=Object.assign({},e),Object.keys(this._metaMap).forEach((function(t){var e=r._metaMap[t].pageKeys;r._metaMap[t].pages=e.map((function(t){return function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.key===e)return r}return{path:"",frontmatter:{}}}(n,t)}))}))}return Object(Go.a)(t,[{key:"length",get:function(){return Object.keys(this._metaMap).length}},{key:"map",get:function(){return this._metaMap}},{key:"pages",get:function(){return this.list}},{key:"list",get:function(){return this.toArray()}},{key:"toArray",value:function(){var t=this,e=[];return Object.keys(this._metaMap).forEach((function(n){var r=t._metaMap[n],o=r.pages,i=r.path;e.push({name:n,pages:o,path:i})})),e}},{key:"getItemByName",value:function(t){return this._metaMap[t]}}]),t}(),Ko=(n(198),{tags:function(t,e){var r=n(215);return r(t.frontmatter.date)-r(e.frontmatter.date)>0?-1:1},categories:function(t,e){var r=n(215);return r(t.frontmatter.date)-r(e.frontmatter.date)>0?-1:1}}),Zo={tags:function(t,e,n){var r=e;return["tags"].some((function(e){var n=t.frontmatter[e];return Array.isArray(n)?n.some((function(t){return t===r})):n===r}))},categories:function(t,e,n){var r=e;return["categories"].some((function(e){var n=t.frontmatter[e];return Array.isArray(n)?n.some((function(t){return t===r})):n===r}))}},Xo=[{pid:"tags",id:"Hooks",filter:Zo.tags,sorter:Ko.tags,pages:[{path:"/tag/Hooks/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"JavaScript",filter:Zo.tags,sorter:Ko.tags,pages:[{path:"/tag/JavaScript/",interval:[0,7]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"Other",filter:Zo.tags,sorter:Ko.tags,pages:[{path:"/tag/Other/",interval:[0,9]},{path:"/tag/Other/page/2/",interval:[10,13]}],prevText:"Prev",nextText:"Next"},{pid:"tags",id:"vue",filter:Zo.tags,sorter:Ko.tags,pages:[{path:"/tag/vue/",interval:[0,3]}],prevText:"Prev",nextText:"Next"},{pid:"categories",id:"Hooks",filter:Zo.categories,sorter:Ko.categories,pages:[{path:"/categories/Hooks/",interval:[0,1]}],prevText:"Prev",nextText:"Next"},{pid:"categories",id:"JavaScript",filter:Zo.categories,sorter:Ko.categories,pages:[{path:"/categories/JavaScript/",interval:[0,7]}],prevText:"Prev",nextText:"Next"},{pid:"categories",id:"Other",filter:Zo.categories,sorter:Ko.categories,pages:[{path:"/categories/Other/",interval:[0,9]},{path:"/categories/Other/page/2/",interval:[10,13]}],prevText:"Prev",nextText:"Next"},{pid:"categories",id:"Vue",filter:Zo.categories,sorter:Ko.categories,pages:[{path:"/categories/Vue/",interval:[0,3]}],prevText:"Prev",nextText:"Next"}],ti=n(224),ei=n.n(ti)()("plugin-blog:pagination"),ni=function(){function t(e,n,r){Object(Jo.a)(this,t),ei("pagination",e);var o=e.pages,i=e.prevText,a=e.nextText,s=r.path;this._prevText=i,this._nextText=a;for(var u=0,c=o.length;u<c;u++){if(o[u].path===s){this.paginationIndex=u;break}}this.paginationIndex||(this.paginationIndex=0),this._paginationPages=o,this._currentPage=o[this.paginationIndex],this._matchedPages=n.filter((function(t){return e.filter(t,e.id,e.pid)})).sort(e.sorter)}return Object(Go.a)(t,[{key:"setIndexPage",value:function(t){this._indexPage=t}},{key:"length",get:function(){return this._paginationPages.length}},{key:"pages",get:function(){var t=be(this._currentPage.interval,2),e=t[0],n=t[1];return this._matchedPages.slice(e,n+1)}},{key:"hasPrev",get:function(){return 0!==this.paginationIndex}},{key:"prevLink",get:function(){return this.hasPrev?this.paginationIndex-1==0&&this._indexPage?this._indexPage:this._paginationPages[this.paginationIndex-1].path:null}},{key:"hasNext",get:function(){return this.paginationIndex!==this.length-1}},{key:"nextLink",get:function(){return this.hasNext?this._paginationPages[this.paginationIndex+1].path:null}},{key:"prevText",get:function(){return this._prevText}},{key:"nextText",get:function(){return this._nextText}},{key:"getSpecificPageLink",value:function(t){return this._paginationPages[t].path}}]),t}(),ri=new(function(){function t(e){Object(Jo.a)(this,t),this.paginations=e}return Object(Go.a)(t,[{key:"pages",get:function(){return i.default.$vuepress.$get("siteData").pages}},{key:"getPagination",value:function(t,e,n){ei("id",e),ei("pid",t);var r=this.paginations.filter((function(n){return n.id===e&&n.pid===t}))[0];return new ni(r,this.pages,n)}}]),t}())(Xo),oi={comment:{enabled:!1,service:""},email:{enabled:!1},feed:{rss:!1,atom:!1,json:!1}};var ii=[function(t){var e=t.Vue,n=(t.siteData,t.isServer,t.router);Object(cn.c)(e),e.mixin(Ke),e.mixin(sn),Object(un.c)(n),Object(un.a)(n)},{},function(t){t.Vue.mixin({computed:{$dataBlock:function(){return this.$options.__data__block__}}})},{},function(t){t.Vue.component("BackToTop",fn)},function(t){t.Vue.component("Pagation",yn)},function(t){t.Vue.mixin({computed:{$perPage:function(){return 10}}})},function(t){var e=t.Vue;e.component("Comments",Vo),e.component("AccessNumber",qo)},{},function(t){var e=t.Vue,n=Object.keys(Qo).map((function(t){var e,n=Qo[t],r="$".concat(t);return e={},Object(Wo.a)(e,r,(function(){var t=this.$site.pages;return new Yo(n,t)})),Object(Wo.a)(e,"$current".concat(t.charAt(0).toUpperCase()+t.slice(1)),(function(){var t=this.$route.meta.id;return this[r].getItemByName(t)})),e})).reduce((function(t,e){return Object.assign(t,e),t}),{});n.$frontmatterKey=function(){var t=this["$".concat(this.$route.meta.id)];return t||null},e.mixin({computed:n})},function(t){t.Vue.mixin({computed:{$pagination:function(){return this.$route.meta.pid&&this.$route.meta.id?this.$getPagination(this.$route.meta.pid,this.$route.meta.id):null}},methods:{$getPagination:function(t,e){return e=e||t,ri.getPagination(t,e,this.$route)}}})},function(t){var e={$service:function(){return oi}};t.Vue.mixin({computed:e})},function(t){var e=t.Vue;t.router.options.scrollBehavior=function(t,n,r){if(r)return window.scrollTo({top:r.y,behavior:"smooth"});if(!t.hash)return window.scrollTo({top:0,behavior:"smooth"});if(!e.$vuepress.$get("disableScrollBehavior")){var o,i,a,s=document.querySelector(t.hash);return s?window.scrollTo({top:(o=s,i=document.documentElement.getBoundingClientRect(),a=o.getBoundingClientRect(),{x:a.left-i.left,y:a.top-i.top}).y,behavior:"smooth"}):void 0}}}],ai=["BackToTop"];var si=n(138),ui=n(137),ci=function(t){Object(si.a)(n,t);var e=Object(ui.a)(n);function n(){return Object(Jo.a)(this,n),e.apply(this,arguments)}return n}(function(){function t(){Object(Jo.a)(this,t),this.store=new i.default({data:{state:{}}})}return Object(Go.a)(t,[{key:"$get",value:function(t){return this.store.state[t]}},{key:"$set",value:function(t,e){i.default.set(this.store.state,t,e)}},{key:"$emit",value:function(){var t;(t=this.store).$emit.apply(t,arguments)}},{key:"$on",value:function(){var t;(t=this.store).$on.apply(t,arguments)}}]),t}());Object.assign(ci.prototype,{getPageAsyncComponent:pe,getLayoutAsyncComponent:de,getAsyncComponent:he,getVueComponent:ve});var li={install:function(t){var e=new ci;t.$vuepress=e,t.prototype.$vuepress=e}};function fi(t){t.beforeEach((function(e,n,r){if(pi(t,e.path))r();else if(/(\/|\.html)$/.test(e.path))if(/\/$/.test(e.path)){var o=e.path.replace(/\/$/,"")+".html";pi(t,o)?r(o):r()}else r();else{var i=e.path+"/",a=e.path+".html";pi(t,a)?r(a):pi(t,i)?r(i):r()}}))}function pi(t,e){var n=e.toLowerCase();return t.options.routes.some((function(t){return t.path.toLowerCase()===n}))}var di={props:{pageKey:String,slotKey:{type:String,default:"default"}},render:function(t){var e=this.pageKey||this.$parent.$page.key;return ge("pageKey",e),i.default.component(e)||i.default.component(e,pe(e)),i.default.component(e)?t(e):t("")}},hi={functional:!0,props:{slotKey:String,required:!0},render:function(t,e){var n=e.props,r=e.slots;return t("div",{class:["content__".concat(n.slotKey)]},r()[n.slotKey])}},vi={computed:{openInNewWindowTitle:function(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},mi=(n(420),n(421),Object(We.a)(vi,(function(){var t=this.$createElement,e=this._self._c||t;return e("span",[e("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[e("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),e("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),e("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports);function gi(){return(gi=o(regeneratorRuntime.mark((function t(e){var n,r,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n="undefined"!=typeof window&&window.__VUEPRESS_ROUTER_BASE__?window.__VUEPRESS_ROUTER_BASE__:Qe.routerBase||Qe.base,fi(r=new Qt({base:n,mode:"history",fallback:!1,routes:Ge,scrollBehavior:function(t,e,n){return n||(t.hash?!i.default.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(t.hash)}:{x:0,y:0})}})),o={},t.prev=4,t.next=7,Promise.all(ii.filter((function(t){return"function"==typeof t})).map((function(t){return t({Vue:i.default,options:o,router:r,siteData:Qe,isServer:e})})));case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(4),console.error(t.t0);case 12:return a=new i.default(Object.assign(o,{router:r,render:function(t){return t("div",{attrs:{id:"app"}},[t("RouterView",{ref:"layout"}),t("div",{class:"global-ui"},ai.map((function(e){return t(e)})))])}})),t.abrupt("return",{app:a,router:r});case 14:case"end":return t.stop()}}),t,null,[[4,9]])})))).apply(this,arguments)}i.default.config.productionTip=!1,i.default.use(Qt),i.default.use(li),i.default.mixin(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.default;Yt(e),n.$vuepress.$set("siteData",e);var r=t(n.$vuepress.$get("siteData")),o=new r,a=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(o)),s={};return Object.keys(a).reduce((function(t,e){return e.startsWith("$")&&(t[e]=a[e].get),t}),s),{computed:s}}((function(t){return function(){function e(){Object(Jo.a)(this,e)}return Object(Go.a)(e,[{key:"setPage",value:function(t){this.__page=t}},{key:"$site",get:function(){return t}},{key:"$themeConfig",get:function(){return this.$site.themeConfig}},{key:"$frontmatter",get:function(){return this.$page.frontmatter}},{key:"$localeConfig",get:function(){var t,e,n=this.$site.locales,r=void 0===n?{}:n;for(var o in r)"/"===o?e=r[o]:0===this.$page.path.indexOf(o)&&(t=r[o]);return t||e||{}}},{key:"$siteTitle",get:function(){return this.$localeConfig.title||this.$site.title||""}},{key:"$canonicalUrl",get:function(){var t=this.$page.frontmatter.canonicalUrl;return"string"==typeof t&&t}},{key:"$title",get:function(){var t=this.$page,e=this.$page.frontmatter.metaTitle;if("string"==typeof e)return e;var n=this.$siteTitle,r=t.frontmatter.home?null:t.frontmatter.title||t.title;return n?r?r+" | "+n:n:r||"VuePress"}},{key:"$description",get:function(){var t=function(t){if(t){var e=t.filter((function(t){return"description"===t.name}))[0];if(e)return e.content}}(this.$page.frontmatter.meta);return t||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}},{key:"$lang",get:function(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}},{key:"$localePath",get:function(){return this.$localeConfig.path||"/"}},{key:"$themeLocaleConfig",get:function(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}},{key:"$page",get:function(){return this.__page?this.__page:function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.path.toLowerCase()===e.toLowerCase())return r}return{path:"",frontmatter:{}}}(this.$site.pages,this.$route.path)}}]),e}()}),Qe)),i.default.component("Content",di),i.default.component("ContentSlotsDistributor",hi),i.default.component("OutboundLink",mi),i.default.component("ClientOnly",{functional:!0,render:function(t,e){var n=e.parent,r=e.children;if(n._isMounted)return r;n.$once("hook:mounted",(function(){n.$forceUpdate()}))}}),i.default.component("Layout",de("Layout")),i.default.component("NotFound",de("NotFound")),i.default.prototype.$withBase=function(t){var e=this.$site.base;return"/"===t.charAt(0)?e+t.slice(1):t},window.__VUEPRESS__={version:"1.8.2",hash:"eb42cfe"},function(t){return gi.apply(this,arguments)}(!1).then((function(t){var e=t.app;t.router.onReady((function(){e.$mount("#app")}))}))}]); \ No newline at end of file diff --git a/categories/Hooks/index.html b/categories/Hooks/index.html new file mode 100644 index 0000000..6e54bd9 --- /dev/null +++ b/categories/Hooks/index.html @@ -0,0 +1,85 @@ +<!DOCTYPE html> +<html lang="en-US"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width,initial-scale=1"> + <title>Hooks Categories | Zzongke + + + + + + + + + + + + + diff --git a/categories/JavaScript/index.html b/categories/JavaScript/index.html new file mode 100644 index 0000000..7173598 --- /dev/null +++ b/categories/JavaScript/index.html @@ -0,0 +1,85 @@ + + + + + + JavaScript Categories | Zzongke + + + + + + + + + + + + + diff --git a/categories/Other/index.html b/categories/Other/index.html new file mode 100644 index 0000000..48a2882 --- /dev/null +++ b/categories/Other/index.html @@ -0,0 +1,85 @@ + + + + + + Other Categories | Zzongke + + + + + + + + + + + + + diff --git a/categories/Other/page/2/index.html b/categories/Other/page/2/index.html new file mode 100644 index 0000000..fb79ed0 --- /dev/null +++ b/categories/Other/page/2/index.html @@ -0,0 +1,85 @@ + + + + + + Page 2 - Other | Categories | Zzongke + + + + + + + + + + + + + diff --git a/categories/Vue/index.html b/categories/Vue/index.html new file mode 100644 index 0000000..18af462 --- /dev/null +++ b/categories/Vue/index.html @@ -0,0 +1,85 @@ + + + + + + Vue Categories | Zzongke + + + + + + + + + + + + + diff --git a/categories/index.html b/categories/index.html new file mode 100644 index 0000000..35738e3 --- /dev/null +++ b/categories/index.html @@ -0,0 +1,85 @@ + + + + + + Categories | Zzongke + + + + + + + + + + + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..fe744bd --- /dev/null +++ b/index.html @@ -0,0 +1,99 @@ + + + + + + Zzongke + + + + + + + + + +
hero

+ Normal No More! +

+ zzk的Blog +

12/2/2023 Hooks
6/26/2022 Other
5/24/2022 JavaScript
5/23/2022 JavaScript
5/12/2022 Other
4/7/2022 JavaScript
3/30/2022 JavaScript
3/15/2022 vue
3/9/2022 JavaScript
3/8/2022 Other
123 Next Jump To Go
author-avatar

+ Zzongke +

24

Articles

4

Tags

Categories


Tags

AllHooksJavaScriptOthervue

Friend Links

+ + + diff --git a/logo.jpg b/logo.jpg new file mode 100644 index 0000000..4ba7d3d Binary files /dev/null and b/logo.jpg differ diff --git a/tag/Hooks/index.html b/tag/Hooks/index.html new file mode 100644 index 0000000..c6a34f0 --- /dev/null +++ b/tag/Hooks/index.html @@ -0,0 +1,85 @@ + + + + + + Hooks Tags | Zzongke + + + + + + + + + + + + + diff --git a/tag/JavaScript/index.html b/tag/JavaScript/index.html new file mode 100644 index 0000000..f1c8415 --- /dev/null +++ b/tag/JavaScript/index.html @@ -0,0 +1,85 @@ + + + + + + JavaScript Tags | Zzongke + + + + + + + + + + + + + diff --git a/tag/Other/index.html b/tag/Other/index.html new file mode 100644 index 0000000..4071ca0 --- /dev/null +++ b/tag/Other/index.html @@ -0,0 +1,85 @@ + + + + + + Other Tags | Zzongke + + + + + + + + + + + + + diff --git a/tag/Other/page/2/index.html b/tag/Other/page/2/index.html new file mode 100644 index 0000000..b277244 --- /dev/null +++ b/tag/Other/page/2/index.html @@ -0,0 +1,85 @@ + + + + + + Page 2 - Other | Tags | Zzongke + + + + + + + + + + + + + diff --git a/tag/index.html b/tag/index.html new file mode 100644 index 0000000..a82de2a --- /dev/null +++ b/tag/index.html @@ -0,0 +1,85 @@ + + + + + + Tags | Zzongke + + + + + + + + + + + + + diff --git a/tag/vue/index.html b/tag/vue/index.html new file mode 100644 index 0000000..0593449 --- /dev/null +++ b/tag/vue/index.html @@ -0,0 +1,85 @@ + + + + + + vue Tags | Zzongke + + + + + + + + + + + + + diff --git a/timeline/index.html b/timeline/index.html new file mode 100644 index 0000000..9106baf --- /dev/null +++ b/timeline/index.html @@ -0,0 +1,85 @@ + + + + + + Timeline | Zzongke + + + + + + + + + +
  • 2023

    • 12-2 usePromiseReadyFn
  • 2022

    • 6-26 SEO优化重要的元标签
    • 5-24 event loop、宏任务和微任务
    • 5-23 数据类型的判断
    • 5-12 video鼠标移动预览
    • 4-7 this指向
    • 3-30 JavaScript数组的常用方法有哪些
    • 3-15 30 道 Vue 面试题
    • 3-9 上拉加载下拉刷新
    • 3-8 Ajax原理和实现
    • 3-6 TCP为什么需要三次握手和四次挥手
    • 3-5 地址栏输入 URL 敲下回车
    • 3-5 HTTP 常见的状态码
    • 3-5 HTTP和HTTPS的区别
    • 3-3 SPA(单页应用)首屏加载速度
    • 3-1 Git常用指令
    • 3-1 浅拷贝和深拷贝
    • 3-1 函数防抖和节流
    • 3-1 CentOS8配置Nginx
    • 3-1 Markdown 语法指南
    • 3-1 模糊搜索关键词高亮显示
    • 2-16 其它
    • 2-16 Vue的nextTick源码解析
    • 2-15 Vue常见问题
+ + +