Skip to content

Commit

Permalink
Rename composable with Mgl prefix to fit standards
Browse files Browse the repository at this point in the history
  • Loading branch information
Gugustinette committed Jul 29, 2024
1 parent 974fc04 commit c58c422
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export default defineConfig({
{ text: 'Introduction', link: '/components/introduction' },
]
},
{
text: 'Composables',
items: [
{ text: 'Introduction', link: '/composables/introduction' },
]
},
{
text: 'About',
items: [
Expand Down
13 changes: 13 additions & 0 deletions docs/composables/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
outline: deep
---

::: info
For further documentation, you can refer to the [vue-maplibre-gl documentation](https://indoorequal.github.io/vue-maplibre-gl/examples/use-map.html) that already include guides, API references, and examples.

If you find any errors related the Nuxt module (a composable not available for example), please open an issue on the [GitHub repository](https://github.com/gugustinette/nuxt-maplibre).
:::

::: tip
Note that composables are exported with the `Mgl` prefix added to the name of the composable. For example, the `useMap` composable is exported as `useMglMap`.
:::
2 changes: 1 addition & 1 deletion playground/pages/map/map-basic.client.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const style = 'https://api.maptiler.com/maps/streets/style.json?key=cQX2iET1gmOW
const center = [-1.559482, 47.21322];
const zoom = 8;
const map = useMap();
const map = useMglMap();
console.log(map.isLoaded)
console.log(map.isMounted)
console.log(map.instance)
Expand Down
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default defineNuxtModule<ModuleOptions>({
for (const composable of composables) {
addImports({
name: composable,
as: composable,
as: 'useMgl' + composable.slice(3),
from: '@indoorequal/vue-maplibre-gl'
})
}
Expand Down

0 comments on commit c58c422

Please sign in to comment.