Skip to content

Commit

Permalink
Vue.nextTick -> setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
HcySunYang committed Mar 2, 2018
1 parent 137de9b commit 28fbe5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion note/2Vue构造函数.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ Vue.prototype.$mount = function (

首先在 `Vue.prototype` 上添加 `__patch__` 方法,如果在浏览器环境运行的话,这个方法的值为 `patch` 函数,否则是一个空函数 `noop`。然后又在 `Vue.prototype` 上添加了 `$mount` 方法,我们暂且不关心 `$mount` 方法的内容和作用。

之后的一段代码是 `vue-devtools` 的全局钩子,它被包裹在 `Vue.nextTick`(对于 `Vue.nextTick` 我们会单独讲到),最后导出了 `Vue`
之后的一段代码是 `vue-devtools` 的全局钩子,它被包裹在 `setTimeout` 中,最后导出了 `Vue`

现在我们就看完了 `platforms/web/runtime/index.js` 文件,该文件的作用是对 `Vue` 进行平台化的包装:

Expand Down

0 comments on commit 28fbe5b

Please sign in to comment.