You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-10Lines changed: 25 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,11 +7,6 @@ Vue 2 plugin for **Composition API**
7
7
8
8
English | [中文](./README.zh-CN.md) ・ [**Composition API Docs**](https://composition-api.vuejs.org/)
9
9
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
-
15
10
## Installation
16
11
17
12
### NPM
@@ -45,14 +40,14 @@ Include `@vue/composition-api` after Vue and it will install itself automaticall
`@vue/composition-api` will be exposed to global variable `window.vueCompositionApi`.
47
+
`@vue/composition-api` will be exposed to global variable `window.VueCompositionAPI`.
53
48
54
49
```ts
55
-
const { ref, reactive } =vueCompositionApi
50
+
const { ref, reactive } =VueCompositionAPI
56
51
```
57
52
58
53
## TypeScript Support
@@ -99,8 +94,7 @@ export default {
99
94
100
95
## Limitations
101
96
102
-
> :white_check_mark:
103
-
> Support :x: Not Supported
97
+
> :white_check_mark: Support :x: Not Supported
104
98
105
99
### `Ref` Unwrap
106
100
@@ -375,6 +369,27 @@ watch(() => {
375
369
376
370
</details>
377
371
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
+
378
393
### Missing APIs
379
394
380
395
The following APIs introduced in Vue 3 are not available in this plugin.
0 commit comments