Skip to content

Commit 5518be1

Browse files
authored
Merge pull request #390 from vuejs/rc
Preparing for v1.0.0
2 parents 0840aa8 + 82ab91b commit 5518be1

24 files changed

+458
-225
lines changed

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ Vue 2 plugin for **Composition API**
77

88
English | [中文](./README.zh-CN.md)[**Composition API Docs**](https://composition-api.vuejs.org/)
99

10-
11-
**Note: the primary goal of this package is to allow the community to experiment with the API and provide feedback before it's finalized. The implementation may contain minor inconsistencies with the RFC as the latter gets updated. We do not recommend using this package for production yet at this stage.**
12-
13-
---
14-
1510
## Installation
1611

1712
### NPM
@@ -45,14 +40,14 @@ Include `@vue/composition-api` after Vue and it will install itself automaticall
4540
<!--cdn-links-start-->
4641
```html
4742
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
48-
<script src="https://cdn.jsdelivr.net/npm/@vue/[email protected].7"></script>
43+
<script src="https://cdn.jsdelivr.net/npm/@vue/[email protected].5"></script>
4944
```
5045
<!--cdn-links-end-->
5146

52-
`@vue/composition-api` will be exposed to global variable `window.vueCompositionApi`.
47+
`@vue/composition-api` will be exposed to global variable `window.VueCompositionAPI`.
5348

5449
```ts
55-
const { ref, reactive } = vueCompositionApi
50+
const { ref, reactive } = VueCompositionAPI
5651
```
5752

5853
## TypeScript Support
@@ -99,8 +94,7 @@ export default {
9994

10095
## Limitations
10196

102-
> :white_check_mark:
103-
> Support &nbsp;&nbsp;&nbsp;&nbsp;:x: Not Supported
97+
> :white_check_mark: Support &nbsp;&nbsp;&nbsp;&nbsp;:x: Not Supported
10498
10599
### `Ref` Unwrap
106100

@@ -375,6 +369,27 @@ watch(() => {
375369

376370
</details>
377371

372+
### createApp
373+
374+
<details>
375+
<summary>
376+
⚠️ <code>createApp()</code> is global
377+
</summary>
378+
379+
In Vue 3, `createApp()` is introduced to provide context(plugin, components, etc.) isolation between app instances. Due the the design of Vue 2, in this plugin, we provide `createApp()` as a forward compatible API which is just an alias of the global.
380+
381+
```ts
382+
const app1 = createApp(RootComponent1)
383+
app1.component('Foo', Foo) // equivalent to Vue.component('Foo', Foo)
384+
app1.use(VueRouter) // equivalent to Vue.use(VueRouter)
385+
386+
const app2 = createApp(RootComponent2)
387+
app2.component('Bar', Bar) // equivalent to Vue.use('Bar', Bar)
388+
```
389+
390+
</details>
391+
392+
378393
### Missing APIs
379394

380395
The following APIs introduced in Vue 3 are not available in this plugin.

0 commit comments

Comments
 (0)