-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModuloNormativa.vue
77 lines (74 loc) · 1.5 KB
/
ModuloNormativa.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
66
67
68
69
70
71
72
73
74
75
76
77
<template>
<article class="normativa-module">
<nuxt-link :to="url">
<div class="main">
<h4>{{ titulo }}</h4>
<p>{{ bajada }}</p>
</div>
<div class="extra">
<small
v-if="categoria"
:class="`tag normativa-module__tag ${categoriaUri}`"
>{{ categoria }}</small
>
<time v-if="fecha" :datetime="fecha | fecha('yyyy-MM-dd')">{{
fecha | fecha("dd/MM/yyyy")
}}</time>
<FavoriteStar
:activa="enFavoritos"
@click.native.prevent="toggleFavorito(id)"
/>
</div>
</nuxt-link>
</article>
</template>
<script>
import FavoriteStar from "~/components/FavoriteStar.vue";
import { mapActions } from "vuex";
export default {
components: {
FavoriteStar,
},
props: {
id: {
type: Number,
required: true,
},
titulo: {
type: String,
required: true,
},
bajada: {
type: String,
required: true,
},
categoria: {
type: String,
default: "",
},
categoriaUri: {
type: String,
default: "",
},
fecha: {
type: String,
required: true,
},
url: {
type: String,
required: true,
},
},
computed: {
enFavoritos() {
return this.$store.getters["normativas/enFavoritos"](this.id);
},
},
methods: {
...mapActions("normativas", ["toggleFavorito"]),
},
};
</script>
<style lang="sass">
@import 'sass/components/modulo-normativa.sass'
</style>