8000 docs: update Chinese README (#848) · vuejs/composition-api@7c761b1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7c761b1

Browse files
authored
docs: update Chinese README (#848)
1 parent 74a3490 commit 7c761b1

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.zh-CN.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const { ref, reactive } = VueCompositionAPI
5252

5353
## F538 TypeScript 支持
5454

55-
> 本插件要求使用 TypeScript **3.5.1** 或以上版本
55+
> 本插件要求使用 TypeScript **4.2** 或以上版本
5656
5757
为了让 TypeScript 在 Vue 组件选项中正确地进行类型推导,我们必须使用 `defineComponent` 来定义组件:
5858

@@ -384,6 +384,26 @@ watch(
384384

385385
</details>
386386

387+
### `createApp`
388+
389+
<details>
390+
<summary>
391+
⚠️ <code>createApp()</code> 是全局的
392+
</summary>
393+
394+
在 Vue3 中,引入了 `createApp()` 来隔离不同应用实例的上下文(plugin, components 等)。 由于 Vue2 的设计,在这个插件中,我们提供 `createApp()` 作为一个向前兼容的 API ,它只是全局的一个别名。
395+
396+
```ts
397+
const app1 = createApp(RootComponent1)
398+
app1.component('Foo', Foo) // 相当于 Vue.component('Foo', Foo)
399+
app1.use(VueRouter) // 相当于 Vue.use(VueRouter)
400+
401+
const app2 = createApp(RootComponent2)
402+
app2.component('Bar', Bar) // 相当于 Vue.use('Bar', Bar)
403+
```
404+
405+
</details>
406+
387407
### `shallowReadonly`
388408

389409
<details>

0 commit comments

Comments
 (0)
0