forked from EnergySage/es-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EsNavBarFeaturedArticle.vue
65 lines (62 loc) · 1.5 KB
/
EsNavBarFeaturedArticle.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<template>
<div class="dropdown-cta-right">
<es-nav-bar-link
class="d-block cta-link text-gray-900 text-decoration-none"
:href="link"
:target="newTab ? '_blank' : null"
:title="name">
<img
:id="graphicId"
class="featured-article-image mb-100 w-100 rounded"
:alt="imageAlt"
loading="lazy"
:src="image500">
<div class="eyebrow mb-50 link-name">
{{ eyebrow }}
</div>
<p class="font-weight-bold link-subheading">
{{ name }}
</p>
</es-nav-bar-link>
</div>
</template>
<script lang="js">
import EsNavBarLink from './EsNavBarLink.vue';
export default {
name: 'EsNavBarFeaturedArticle',
components: {
EsNavBarLink,
},
props: {
eyebrow: {
type: String,
required: true,
},
link: {
type: String,
required: true,
},
newTab: {
type: Boolean,
default: false,
},
name: {
type: String,
required: true,
},
image500: {
type: String,
required: true,
},
imageAlt: {
type: String,
default: '',
},
},
computed: {
graphicId() {
return this.name.replace(/\s/g, '-').replace(/[^a-zA-Z]/g, '');
},
},
};
</script>