Skip to content

Commit

Permalink
fix: console warnings (#397)
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
jonashae and Jonas Hunfeld-Häutle authored Dec 17, 2024
1 parent 9451194 commit 82aff4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/layers/OlTileLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</template>

<script setup lang="ts">
import { provide } from "vue";
import { provide, toRefs } from "vue";
import TileLayer from "ol/layer/Tile";
import useLayer from "@/composables/useLayer";
import {
Expand All @@ -25,7 +25,7 @@ const props = withDefaults(
},
);
const { layer } = useLayer(TileLayer, props);
const { layer } = useLayer(TileLayer, toRefs(props));
provide("tileLayer", layer);
Expand Down
2 changes: 1 addition & 1 deletion src/composables/usePropsAsObjectProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function checkAndUpdateStylePropDef<T extends Record<string, unknown>>(
options: T,
) {
if ("styles" in options) {
const { styles, ...rest } = toRefs(options);
const { styles, ...rest } = toRefs(reactive(options));
return { style: styles, ...rest } as OlClassOptions<T>;
} else {
return options as OlClassOptions<T>;
Expand Down

0 comments on commit 82aff4c

Please sign in to comment.