12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <template>
- <div
- id="corpus"
- class="full-width"
- >
- <h1>Corpus</h1>
- <span v-if="!items.length">Loading ...</span>
- <div v-else class="item-list">
- <ul>
- <li v-for="item in items" :key="item.url">
- <CorpusItem :item="item" />
- </li>
- </ul>
- </div>
- </div>
- </template>
- <script>
- import CorpusItem from '../components/Content/CorpusItem'
- import { mapState, mapActions } from 'vuex'
- export default {
- name: 'Corpus',
- components: {
- CorpusItem
- },
- 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>
|