Skip to content

Commit 1878f00

Browse files
committed
docs: update
1 parent 7e6598c commit 1878f00

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +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-
</p>
11-
1210
## Installation
1311

1412
```bash
@@ -27,22 +25,21 @@ The package will be exposed to global variable `window.vueCompositionApi`
2725

2826
## Usage
2927

30-
You must install `@vue/composition-api` via `Vue.use()` before using other APIs:
28+
You must install `@vue/composition-api` via `Vue.use()` before you can use the [Composition API](https://composition-api.vuejs.org/) to compose your component.
3129

3230
```js
33-
import Vue from 'vue';
34-
import VueCompositionApi from '@vue/composition-api';
31+
import Vue from 'vue'
32+
import VueCompositionApi from '@vue/composition-api'
3533

36-
Vue.use(VueCompositionApi);
34+
Vue.use(VueCompositionApi)
3735
```
3836

39-
After installing the plugin you can use the [Composition API](https://composition-api.vuejs.org/) to compose your component.
4037

4138
## TypeScript Support
4239

4340
> TypeScript version **>3.5.1** is required
4441
45-
To let TypeScript properly infer types inside Vue component options, you need to define components with `defineComponent`:
42+
To let TypeScript properly infer types inside Vue component options, you need to define components with `defineComponent`
4643

4744
```ts
4845
import { defineComponent } from '@vue/composition-api';
@@ -91,9 +88,9 @@ declare global {
9188
9289
### Performance Impact
9390

94-
Due the the limitation of Vue2's public API. `@vue/composition-api` inevitably introduced some extract costs. This should not concern you in most of the cases.
91+
Due the the limitation of Vue2's public API. `@vue/composition-api` inevitably introduced some extract costs.
9592

96-
You can check the [benchmarks](https://antfu.github.io/vue-composition-api-benchmark-results/) that comparing with Vue 2's option API and vue-next.
93+
You can check the [benchmark results](https://antfu.github.io/vue-composition-api-benchmark-results/) for more details.
9794

9895

9996
### `Ref` Unwrap
@@ -295,7 +292,7 @@ import VueCompositionApi from '@vue/composition-api';
295292

296293
Vue.use(VueCompositionApi);
297294

298-
declare module '@vue/composition-api/dist/component/component' {
295+
declare module '@vue/composition-api' {
299296
interface SetupContext {
300297
readonly refs: { [key: string]: Vue | Element | Vue[] | Element[] };
301298
}

0 commit comments

Comments
 (0)