123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <template>
- <MainContentLayout id="list-corpus">
- <template v-slot:header>
- <h1>Corpus</h1>
- <span v-if="!items.length">Loading ...</span>
- </template>
- <ul v-if="items.length" class="item-list">
- <li v-for="item in items" :key="item.uuid">
- <CorpusItem :item="item" />
- </li>
- </ul>
- <template v-slot:nav />
- </MainContentLayout>
- </template>
- <script>
- import CorpusItem from '../components/Content/CorpusItem'
- import MainContentLayout from '../components/Layouts/MainContentLayout'
- import { mapState, mapActions } from 'vuex'
- export default {
- name: 'ListCorpus',
- components: {
- CorpusItem,
- MainContentLayout
- },
- data: () => ({
- // items: []
- }),
- computed: {
- ...mapState({
- items: state => state.Corpus.items
- })
- },
- created () {
- if (!this.items.length) {
- this.getItems()
- }
- },
- methods: {
- ...mapActions({
- getItems: 'Corpus/getItems'
- })
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|