Skip to content

JavaScript 核心 ​

面试高频考点,也是读懂 Vue 源码的基础。

目录 ​

  1. 原型链 - prototype / __proto__ / instanceof / Vue 2 数组劫持
  2. this 绑定 - 5 种规则 / 优先级 / call apply bind / Vue initMethods
  3. 闭包 - 形成条件 / 生命周期 / defineReactive 的 val 闭包
  4. 事件循环 - 宏任务 / 微任务 / $nextTick / 异步批量更新
  5. Promise - 状态机 / then 链 / all / async/await
  6. WeakMap / Map / Set - 弱引用 / GC / Vue 3 响应式存储
  7. Proxy / Reflect - 13 种拦截 / reactive 实现 / 与 defineProperty 对比
  8. Class - 本质是语法糖 / extends/super / 为何 Vue 3 放弃 Class API

基于 Vue 2.7 & Vue 3.4 源码