Skip to content

Commit

Permalink
docs: emphasize vue2 prerequisites (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianOsipiuk authored Feb 24, 2022
1 parent 59345c1 commit 66fd6aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Based on [react-query](https://github.com/tannerlinsley/react-query)

Visit https://vue-query.vercel.app

For topics not covered in vue-query docs visit https://react-query.tanstack.com/reference/useQuery as most of the concepts and API are the same.
For topics not covered in `vue-query` docs visit [react-query docs](https://react-query.tanstack.com/reference/useQuery) as most of the concepts and APIs are the same.

# Quick Features

Expand All @@ -39,7 +39,16 @@ For topics not covered in vue-query docs visit https://react-query.tanstack.com/

# Quick Start

1. Initialize **Vue Query** via **VueQueryPlugin**
1. Install `vue-query`
```bash
npm install vue-query
# or
yarn add vue-query
```

> If you are using Vue 2.x, make sure to also setup [@vue/composition-api](https://github.com/vuejs/composition-api)

2. Initialize **Vue Query** via **VueQueryPlugin**

```ts
import { createApp } from "vue";
Expand All @@ -50,7 +59,7 @@ For topics not covered in vue-query docs visit https://react-query.tanstack.com/
createApp(App).use(VueQueryPlugin).mount("#app");
```
2. Use query
3. Use query
```ts
import { defineComponent } from "vue";
Expand All @@ -68,7 +77,7 @@ For topics not covered in vue-query docs visit https://react-query.tanstack.com/
});
```
3. If you need to update options on your query dynamically, make sure to pass them as reactive variables
4. If you need to update options on your query dynamically, make sure to pass them as reactive variables
```ts
const id = ref(1);
Expand Down
12 changes: 3 additions & 9 deletions docs/getting-started/installation.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
You can install Vue Query with [NPM](https://www.npmjs.com/) or [Yarn](https://yarnpkg.com/)

### NPM

```
```bash
npm install vue-query
```

### Yarn

```
# or
yarn add vue-query
```

Vue Query is compatible with Vue 2.x + composition API or 3.x
> If you are using Vue 2.x, make sure to also setup [@vue/composition-api](https://github.com/vuejs/composition-api)
### Vue Query Initialization

Expand Down

1 comment on commit 66fd6aa

@vercel
Copy link

@vercel vercel bot commented on 66fd6aa Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.