Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

Commit d09a4c7

Browse files
committed
refactor: improve code formatting and consistency in SVG documentation and components
- Updated `use-svg.md` to enhance readability by adjusting the formatting of interface properties and ensuring consistent spacing. - Refactored the `component.vue` file to maintain consistent formatting in the `defineExpose` call, improving code clarity. - These changes contribute to better maintainability and adherence to coding standards across the documentation and component files.
1 parent f0dd535 commit d09a4c7

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

docs/guide/loaders/use-svg.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ The `layers` computed property returns an array of processed SVG elements, each
106106

107107
```ts
108108
interface SVGLayer {
109-
geometry: BufferGeometry // Three.js geometry for the layer
110-
material: MeshBasicMaterialParameters // Material properties
111-
isStroke: boolean // Whether this layer is a stroke or fill
109+
geometry: BufferGeometry // Three.js geometry for the layer
110+
material: MeshBasicMaterialParameters // Material properties
111+
isStroke: boolean // Whether this layer is a stroke or fill
112112
}
113113
```
114114

@@ -133,7 +133,7 @@ const getFillColor = (layer: SVGLayer, index: number) => {
133133
:key="index"
134134
:geometry="layer.geometry"
135135
>
136-
<TresMeshBasicMaterial
136+
<TresMeshBasicMaterial
137137
v-bind="layer.material"
138138
:color="getFillColor(layer, index)"
139139
/>
@@ -262,9 +262,9 @@ import { computed } from 'vue'
262262
const showDetails = ref(true)
263263
const { layers } = useSVG('/detailed-icon.svg')
264264
265-
const visibleLayers = computed(() =>
266-
showDetails.value
267-
? layers.value
265+
const visibleLayers = computed(() =>
266+
showDetails.value
267+
? layers.value
268268
: layers.value.filter(layer => !layer.isStroke)
269269
)
270270
</script>
@@ -289,11 +289,11 @@ const visibleLayers = computed(() =>
289289
import { useSVG } from '@tresjs/cientos'
290290
291291
const { layers } = useSVG('/logo.svg', {
292-
fillMaterial: {
292+
fillMaterial: {
293293
transparent: true,
294-
opacity: 0.9
294+
opacity: 0.9
295295
},
296-
strokeMaterial: {
296+
strokeMaterial: {
297297
transparent: true,
298298
opacity: 1.0,
299299
color: '#000000'
@@ -308,7 +308,7 @@ const { layers } = useSVG('/logo.svg', {
308308
:key="index"
309309
:geometry="layer.geometry"
310310
>
311-
<TresMeshBasicMaterial
311+
<TresMeshBasicMaterial
312312
v-bind="layer.material"
313313
:wireframe="layer.isStroke"
314314
/>
@@ -399,4 +399,4 @@ Here are some things to try if you run into problems:
399399
- Simple, declarative SVG rendering
400400
- Quick prototyping
401401
- Standard SVG display without custom logic
402-
- Less code and setup
402+
- Less code and setup

src/core/loaders/useSVG/component.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const { state, isLoading, layers, dispose } = useSVG(props.src, {
110110
depth: props.depth,
111111
})
112112
113-
defineExpose({
113+
defineExpose({
114114
instance: state,
115115
layers,
116116
})

0 commit comments

Comments
 (0)