Skip to content

Commit

Permalink
adding srcset for HeroImage
Browse files Browse the repository at this point in the history
  • Loading branch information
stephiescastle committed Nov 8, 2024
1 parent 0881a4f commit a9ab697
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/vue/src/components/HeroLarge/HeroLarge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<picture v-if="image && image.src">
<source
media="(min-width: 768px)"
:srcset="image.srcSet"
:srcset="theSrcSet"
/>
<source
media="(min-width: 420px)"
Expand Down Expand Up @@ -71,7 +71,7 @@
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { mixinTransparentHeader } from './../../utils/mixins'
import { mixinTransparentHeader, mixinGetSrcSet } from './../../utils/mixins'
import { mapStores } from 'pinia'
import { useThemeStore } from '../../store/theme'
import BasePill from './../BasePill/BasePill.vue'
Expand Down Expand Up @@ -119,7 +119,14 @@ export default defineComponent({
}
},
computed: {
...mapStores(useThemeStore)
...mapStores(useThemeStore),
theSrcSet() {
return this.image
? mixinGetSrcSet(this.image)
? mixinGetSrcSet(this.image)
: this.image.srcSet
: undefined
}
},
mounted() {
mixinTransparentHeader()
Expand Down

0 comments on commit a9ab697

Please sign in to comment.