Skip to content

Commit 82aff4c

Browse files
jonashaeJonas Hunfeld-Häutle
and
Jonas Hunfeld-Häutle
authored
fix: console warnings (#397)
- add toRefs quickfix in OlTileLayer.vue, props should not bei writeable, so I change the props to a ref - make options reactive to fix the warning in the console Co-authored-by: Jonas Hunfeld-Häutle <[email protected]>
1 parent 9451194 commit 82aff4c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/components/layers/OlTileLayer.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</template>
66

77
<script setup lang="ts">
8-
import { provide } from "vue";
8+
import { provide, toRefs } from "vue";
99
import TileLayer from "ol/layer/Tile";
1010
import useLayer from "@/composables/useLayer";
1111
import {
@@ -25,7 +25,7 @@ const props = withDefaults(
2525
},
2626
);
2727
28-
const { layer } = useLayer(TileLayer, props);
28+
const { layer } = useLayer(TileLayer, toRefs(props));
2929
3030
provide("tileLayer", layer);
3131

Diff for: src/composables/usePropsAsObjectProperties.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function checkAndUpdateStylePropDef<T extends Record<string, unknown>>(
1919
options: T,
2020
) {
2121
if ("styles" in options) {
22-
const { styles, ...rest } = toRefs(options);
22+
const { styles, ...rest } = toRefs(reactive(options));
2323
return { style: styles, ...rest } as OlClassOptions<T>;
2424
} else {
2525
return options as OlClassOptions<T>;

0 commit comments

Comments
 (0)