From 9ed318b4bb715b24a3377a784bb1d53e4aa374e3 Mon Sep 17 00:00:00 2001 From: hspn Date: Fri, 23 Jul 2021 15:59:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/v2/components/create-component.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/v2/components/create-component.md b/docs/v2/components/create-component.md index d71491b5..2d708233 100644 --- a/docs/v2/components/create-component.md +++ b/docs/v2/components/create-component.md @@ -257,7 +257,7 @@ Vue.extend = function (extendOptions: Object): Function { } ``` -`Vue.extend` 的作用就是构造一个 `Vue` 的子类,它使用一种非常经典的原型继承的方式把一个纯对象转换一个继承于 `Vue` 的构造器 `Sub` 并返回,然后对 `Sub` 这个对象本身扩展了一些属性,如扩展 `options`、添加全局 API 等;并且对配置中的 `props` 和 `computed` 做了初始化工作;最后对于这个 `Sub` 构造函数做了缓存,避免多次执行 `Vue.extend` 的时候对同一个子组件重复构造。 +`Vue.extend` 的作用就是构造一个 `Vue` 的子类,它使用一种非常经典的原型继承的方式把一个纯对象转换成一个继承于 `Vue` 的构造器 `Sub` 并返回,然后对 `Sub` 这个对象本身扩展了一些属性,如扩展 `options`、添加全局 API 等;并且对配置中的 `props` 和 `computed` 做了初始化工作;最后对于这个 `Sub` 构造函数做了缓存,避免多次执行 `Vue.extend` 的时候对同一个子组件重复构造。 这样当我们去实例化 `Sub` 的时候,就会执行 `this._init` 逻辑再次走到了 `Vue` 实例的初始化逻辑,实例化子组件的逻辑在之后的章节会介绍。