Skip to content

Commit

Permalink
docs: fix useId composable docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufkandemir authored Jun 27, 2024
1 parent b61b1dd commit 1915789
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docs/src/pages/vue-composables/use-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keys: useId
badge: Quasar v2.15+
---

The `useId()` composable returns an "id" which is a ref() that can be used as a unique identifier to apply to a DOM node attribute.
The `useId()` composable returns a Vue Ref holding a string that can be used as a unique identifier to apply to a DOM node attribute.

Should you supply a function (`getValue` from the typing below) to get the value that the id might have, it will make sure to keep it updated.

Expand All @@ -17,7 +17,7 @@ On SSR, it takes into account the process of hydration so that your component wo
import { useId } from 'quasar'

setup () {
const { id } = useId()
const id = useId()
// ...
}
```
Expand All @@ -28,9 +28,7 @@ function useId(
getValue?: () => string | null | undefined;
required?: boolean; // default: true
}
): {
id: Ref<string>;
};
): Ref<string | null>;
```

## Example
Expand All @@ -51,7 +49,7 @@ export default {
},

setup () {
const { id } = useId({
const id = useId({
getValue: () => props.for,
required: true
})
Expand Down

0 comments on commit 1915789

Please sign in to comment.