Skip to content

Commit

Permalink
fix(image): default props
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelodelain committed May 27, 2024
1 parent 666edcc commit 4103189
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/molecules/VImg/VImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ export default defineComponent({
const width = computed(() => parseSize(props.width))
const height = computed(() => parseSize(props.height))
const modifiers = computed<ImageOptions['modifiers']>(() => ({
...props.modifiers,
width: width.value,
height: height.value,
quality: getInt(props.quality) || $img.options.quality,
format: props.format,
...props.modifiers,
quality: getInt(props.quality || props.modifiers?.quality) || $img.options.quality,
format: props.format || props.modifiers?.format,
}))
const options = computed<ImageOptions>(() => ({
provider: props.provider,
Expand Down
5 changes: 4 additions & 1 deletion components/molecules/VRoadizImage/VRoadizImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export default defineComponent({
($img.options.presets?.default?.sizes || $img.options.screens)) ||
undefined,
provider: 'interventionRequest',
modifiers: modifiers.value,
modifiers: {
...modifiers.value,
format: props.format || 'webp',
},
}
})
const imageComponent = h(isPicture.value ? VPicture : VImg, imageComponentProps.value, slots.default)
Expand Down

0 comments on commit 4103189

Please sign in to comment.