Skip to content

Commit

Permalink
Fix/hero large srcset (#695)
Browse files Browse the repository at this point in the history
* adding srcset for HeroImage

* changeset
  • Loading branch information
stephiescastle authored Nov 12, 2024
1 parent 0881a4f commit c06cf28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/popular-spoons-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@explorer-1/vue": patch
---

Adding srcset to HeroLarge component
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 c06cf28

Please sign in to comment.