Skip to content

Commit 4fe5836

Browse files
committed
docs: Improve README.md
1 parent 3f9fa71 commit 4fe5836

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,35 @@ Please note that Vue 3.0 has not been released yet, therefore the installation a
2626
npm install @vue/composition-api vue-use-kit
2727
```
2828

29+
## Setup
30+
31+
```
32+
import Vue from 'vue';
33+
import VueCompositionAPI from '@vue/composition-api';
34+
Vue.use(VueCompositionAPI);
35+
```
36+
2937
## Usage
3038

31-
Please check the [documentation](https://microcipcip.github.io/vue-use-kit/) to learn how to use this collection of Vue Composition API functions.
39+
```
40+
<template>
41+
<div>isDesktop: {{ isDesktop ? 'Yes' : 'No' }}</div>
42+
</template>
43+
44+
<script lang="ts">
45+
import Vue from 'vue'
46+
import { useMedia } from 'vue-use-kit'
47+
48+
export default Vue.extend({
49+
name: 'UseMedia',
50+
setup() {
51+
const query = '(min-width: 1024px)'
52+
const isDesktop = useMedia(query)
53+
return { isDesktop }
54+
}
55+
})
56+
</script>
57+
```
3258

3359
## APIs
3460

0 commit comments

Comments
 (0)