Skip to content

Commit

Permalink
feat(SVG): remove key
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Aug 30, 2023
1 parent a75d571 commit 01061a9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/core/loaders/SVG/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const props = withDefaults(defineProps<SVGProps>(),
{ skipStrokes: false, skipFills: false }
);
type SVGLayer = { geometry: BufferGeometry, material: MeshBasicMaterialParameters, key: string, isStroke: boolean };
type SVGLayer = { geometry: BufferGeometry, material: MeshBasicMaterialParameters, isStroke: boolean };
const { src, skipStrokes, skipFills, fillMaterial, strokeMaterial, fillMeshProps, strokeMeshProps } = toRefs(props);
const svgRef = shallowRef();
Expand Down Expand Up @@ -125,8 +125,7 @@ function updateLayers() {
_layers.push({
geometry,
material: fillMaterial,
isStroke: false,
key: '' + i++
isStroke: false
})
}
}
Expand All @@ -144,8 +143,7 @@ function updateLayers() {
_layers.push({
geometry,
material,
isStroke: true,
key: '' + i++
isStroke: true
})
}
}
Expand All @@ -158,7 +156,7 @@ function updateLayers() {

<template>
<TresGroup ref="svgRef">
<TresMesh v-for="{ geometry, material, isStroke, key } of layers" :key="key"
<TresMesh v-for="({ geometry, material, isStroke }, i) of layers" :key="i + ''"
v-bind="isStroke ? strokeMeshProps : fillMeshProps" :geometry="geometry">
<TresMeshBasicMaterial v-bind="material" />
</TresMesh>
Expand Down

0 comments on commit 01061a9

Please sign in to comment.