Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active July 8, 2025 11:04
Show Gist options
  • Save Kcko/24b32608f002e4356310349e468e8a47 to your computer and use it in GitHub Desktop.
Save Kcko/24b32608f002e4356310349e468e8a47 to your computer and use it in GitHub Desktop.
<!-- 1 -->
<component
v-if="transport?.image"
:is="typeof transport.image === 'object' ? 'aw-img' : 'img'"
v-bind="
typeof transport.image === 'object'
? { image: transport.image, size: 'eop-icon', style: 'max-width: 40px' }
: { src: transport.image, size: 'eop-icon', style: 'max-width: 40px' }
"
/>
<!-- 2 h render -->
const transportImage = computed(() => {
if (!props.transport?.image) return null
if (typeof props.transport.image === 'object') {
return h(resolveComponent('aw-img'), {
image: props.transport.image,
size: 'eop-icon',
style: 'max-width: 40px'
})
} else {
return h('img', {
src: props.transport.image,
size: 'eop-icon',
style: 'max-width: 40px'
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment