Skip to content

Commit 45021d2

Browse files
committed
docs: use correct dragbox ref
1 parent ea3e63f commit 45021d2

File tree

1 file changed

+4
-6
lines changed
  • docs/componentsguide/interactions/dragbox

1 file changed

+4
-6
lines changed

Diff for: docs/componentsguide/interactions/dragbox/index.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import VectorSourceDemo1 from "@demos/VectorSourceDemo1.vue"
2222
## Usage
2323

2424
| Plugin Usage | Explicit Import |
25-
| -------------------------- | :-----------------------------------: |
25+
|----------------------------|:-------------------------------------:|
2626
| `<ol-interaction-dragbox>` | `<Interactions.OlInteractionDragbox>` |
2727

2828
::: code-group
@@ -65,20 +65,18 @@ To access the source, you can use a `ref()` as shown below:
6565
```vue
6666
<template>
6767
<!-- ... -->
68-
<ol-map ref="mapRef" @error="handleEvent">
69-
<!-- ... -->
70-
</ol-map>
68+
<ol-interaction-dragbox ref="dragboxRef" @error="handleEvent" />
7169
<!-- ... -->
7270
</template>
7371
7472
<script setup lang="ts">
7573
import { ref, onMounted } from "vue";
7674
import type DragBox from "ol/interaction/DragBox";
7775
78-
const drgboxRef = ref<{ dragbox: DragBox } | null>(null);
76+
const dragboxRef = ref<{ dragbox: DragBox } | null>(null);
7977
8078
onMounted(() => {
81-
const dragbox: DragBox = drgboxRef.value?.dragbox;
79+
const dragbox: DragBox = dragboxRef.value?.dragbox;
8280
// call your method on `dragbox`
8381
});
8482
</script>

0 commit comments

Comments
 (0)