@unmap/nuxt 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @unmap/nuxt
|
|
2
|
+
|
|
3
|
+
Nuxt 3 module for [unmap](https://unmap.dev). Publishes `unmap: { key, gateway }` to public
|
|
4
|
+
runtime config and auto-imports the `@unmap/vue` composables (`useUnmap`, `useGeocoder`,
|
|
5
|
+
`useDirections`) into every component.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @unmap/nuxt
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
// nuxt.config.ts
|
|
13
|
+
export default defineNuxtConfig({
|
|
14
|
+
modules: ['@unmap/nuxt'],
|
|
15
|
+
unmap: { key: 'um_live_...' },
|
|
16
|
+
})
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The key can also come from the environment as `NUXT_PUBLIC_UNMAP_KEY`, and the gateway as
|
|
20
|
+
`NUXT_PUBLIC_UNMAP_GATEWAY`. Then, in any component:
|
|
21
|
+
|
|
22
|
+
```vue
|
|
23
|
+
<script setup lang="ts">
|
|
24
|
+
const { mapContainer } = useUnmap({ key: useRuntimeConfig().public.unmap.key, center: [-73.57, 45.5] })
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div ref="mapContainer" style="height: 400px" />
|
|
29
|
+
</template>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Requires Nuxt 3.13 or later. Docs: [unmap.dev/docs](https://unmap.dev/docs/overview).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unmap/nuxt",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Nuxt 3 module for unmap: runtime config + auto-imported @unmap/vue composables",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/module.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@nuxt/kit": "^3.13.0",
|
|
24
|
-
"@unmap/core": "0.0
|
|
25
|
-
"@unmap/vue": "0.0
|
|
24
|
+
"@unmap/core": "0.1.0",
|
|
25
|
+
"@unmap/vue": "0.1.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@nuxt/schema": "^3.13.0",
|