2019-07-12 22:15:09 +02:00
|
|
|
<template>
|
|
|
|
<div id="blabla">
|
2019-07-13 15:40:14 +02:00
|
|
|
<div class="loading" v-if="!items.length">
|
2021-06-01 22:46:15 +02:00
|
|
|
<span>{{ $t('default.Loading…') }}</span>
|
2019-07-13 15:40:14 +02:00
|
|
|
</div>
|
|
|
|
<div class="cards-list" v-else>
|
|
|
|
<ul>
|
2020-12-22 16:36:06 +01:00
|
|
|
<li v-for="item in items" v-bind:key="item.nid">
|
2019-07-14 15:21:04 +02:00
|
|
|
<ArticleCard :item="item"/>
|
2019-07-13 15:40:14 +02:00
|
|
|
</li>
|
|
|
|
</ul>
|
2019-07-14 16:29:17 +02:00
|
|
|
<infinite-loading @infinite="nextPage">
|
|
|
|
<div slot="no-more">No more articles</div>
|
2019-07-13 15:40:14 +02:00
|
|
|
</infinite-loading>
|
|
|
|
</div>
|
2019-07-12 22:15:09 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-07-13 15:40:14 +02:00
|
|
|
|
2019-07-14 15:21:04 +02:00
|
|
|
import ArticleCard from 'vuejs/components/Content/ArticleCard'
|
2019-07-14 16:29:17 +02:00
|
|
|
import { mapState, mapActions } from 'vuex'
|
2019-07-13 15:40:14 +02:00
|
|
|
|
2019-07-12 22:15:09 +02:00
|
|
|
export default {
|
|
|
|
name: "Blabla",
|
2019-07-14 16:29:17 +02:00
|
|
|
// data() {
|
|
|
|
// return {
|
|
|
|
// items:[],
|
|
|
|
// page:0
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
|
|
|
items: state => state.Blabla.items
|
|
|
|
})
|
2019-07-13 15:40:14 +02:00
|
|
|
},
|
2019-07-14 15:21:04 +02:00
|
|
|
created(){
|
2019-07-14 16:29:17 +02:00
|
|
|
if(!this.items.length)
|
|
|
|
this.getItems()
|
2019-07-13 15:40:14 +02:00
|
|
|
},
|
|
|
|
methods: {
|
2019-07-14 16:29:17 +02:00
|
|
|
...mapActions({
|
|
|
|
getItems: 'Blabla/getItems',
|
|
|
|
nextPage: 'Blabla/nextPage'
|
|
|
|
})
|
2019-07-13 15:40:14 +02:00
|
|
|
},
|
|
|
|
components: {
|
2019-07-14 15:21:04 +02:00
|
|
|
ArticleCard
|
2019-07-12 22:15:09 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|