2019-07-14 15:21:04 +02:00
|
|
|
<template>
|
|
|
|
<article class="card article">
|
|
|
|
<header>
|
|
|
|
<h1>
|
|
|
|
<a
|
|
|
|
:href="item.view_node"
|
|
|
|
@click.prevent="onclick"
|
|
|
|
v-html="item.title"
|
|
|
|
></a>
|
|
|
|
</h1>
|
|
|
|
<aside v-html="item.created"></aside>
|
2020-02-19 14:35:49 +01:00
|
|
|
<h4 v-if="false" class="body" v-html="item.body"></h4>
|
2019-07-14 15:21:04 +02:00
|
|
|
</header>
|
|
|
|
<section class="images">
|
2020-02-19 15:30:58 +01:00
|
|
|
<figure v-html="item.field_visuel"></figure>
|
2019-07-14 15:21:04 +02:00
|
|
|
</section>
|
|
|
|
</article>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-12-23 19:11:46 +01:00
|
|
|
// import { JSONAPI } from 'vuejs/api/json-axios'
|
2019-07-14 15:21:04 +02:00
|
|
|
import router from 'vuejs/route'
|
|
|
|
|
|
|
|
let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "ArticleCard",
|
|
|
|
router,
|
|
|
|
props: ['item'],
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
alias: this.item.view_node.replace(/^.?\/blabla\//g, '')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
onclick(){
|
|
|
|
console.log('clicked on article', this.alias);
|
|
|
|
this.$router.push({
|
|
|
|
name:`article`,
|
|
|
|
params: { alias:this.alias },
|
2020-12-22 16:36:06 +01:00
|
|
|
query: { nid: this.item.nid }
|
2019-07-14 15:21:04 +02:00
|
|
|
// meta: { uuid:this.item.uuid },
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|