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>
|
2021-03-09 11:35:00 +01:00
|
|
|
<!-- <h4 class="body" v-html="item.body"></h4> -->
|
2019-07-14 15:21:04 +02:00
|
|
|
</header>
|
|
|
|
<section class="images">
|
2021-03-09 11:35:00 +01:00
|
|
|
<a
|
|
|
|
:href="item.view_node"
|
|
|
|
@click.prevent="onclick"
|
|
|
|
>
|
|
|
|
<figure v-html="item.field_visuel"/>
|
|
|
|
</a>
|
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 {
|
2021-01-19 11:42:14 +01:00
|
|
|
alias: this.item.view_node.replace(/^.*\/blabla\//g, '')
|
2019-07-14 15:21:04 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
onclick(){
|
|
|
|
console.log('clicked on article', this.alias);
|
|
|
|
this.$router.push({
|
|
|
|
name:`article`,
|
2021-03-06 16:46:19 +01:00
|
|
|
params: { alias:this.alias, id: this.item.nid }
|
2020-12-24 17:11:51 +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>
|