Skip to content

Commit

Permalink
chore(docs): add documentation section for composables
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Aug 20, 2024
1 parent 3a504fa commit ddaeea8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/composables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
- SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->

### Registration

To use any composable, import and use it according to documentation or Vue guidelines, for example:

```js static
import { useIsMobile } from '@nextcloud/vue/dist/composables/useIsMobile.js'

export default {
setup() {
return {
isMobile: useIsMobile(),
}
},
}
```
or in `<script setup>`:

```js static
import { useIsMobile } from '@nextcloud/vue/dist/composables/useIsMobile.js'

const isMobile = useIsMobile()
```
7 changes: 7 additions & 0 deletions styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ module.exports = async () => {
},
],
},
{
name: 'Composables',
content: 'docs/composables.md',
sectionDepth: 1,
sections: [
],
},
{
name: 'Components',
content: 'docs/components.md',
Expand Down

0 comments on commit ddaeea8

Please sign in to comment.