Skip to content

Instantly share code, notes, and snippets.

@jahvi
Last active August 11, 2019 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jahvi/d95b87fd4ec0658b65b30bb4332e3582 to your computer and use it in GitHub Desktop.
Save jahvi/d95b87fd4ec0658b65b30bb4332e3582 to your computer and use it in GitHub Desktop.
<template>
<div
class="offer-container col-xs-12 col-sm-6 pb15"
v-if="data"
>
<router-link :to="localizedRoute(link)">
<div
class="offer"
v-lazy:background-image="image"
>
<h2 class="title m0 h1">
{{ title }}
</h2>
<p class="subtitle m0 serif h3 uppercase">
{{ subtitle }}
</p>
</div>
</router-link>
</div>
</template>
<script>
import cmsBlock from 'vsf-cms-block-mixin/components/cmsBlock'
export default {
name: 'LeftBanner',
mixins: [
cmsBlock
],
computed: {
title () {
return this.parsedContent.querySelector('h2').rawText
},
subtitle () {
return this.parsedContent.querySelector('p').rawText
},
link () {
return this.parsedContent.querySelector('a').attributes['href']
},
image () {
return this.parsedContent.querySelector('img').attributes['src']
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment