little more integration, more api review
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: 'CorpusItems',
|
name: 'CorpusItem',
|
||||||
props: {
|
props: {
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<template>
|
||||||
|
<article class="nominum item">
|
||||||
|
<header>
|
||||||
|
<h1>
|
||||||
|
<a
|
||||||
|
:href="item.url"
|
||||||
|
@click.prevent="onclick"
|
||||||
|
@keyup.enter="onclick"
|
||||||
|
v-html="item.title"
|
||||||
|
/>
|
||||||
|
</h1>
|
||||||
|
</header>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'NominumItem',
|
||||||
|
props: {
|
||||||
|
item: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: () => ({
|
||||||
|
|
||||||
|
}),
|
||||||
|
methods: {
|
||||||
|
onclick () {
|
||||||
|
console.log('clicked on nominum item', this.item)
|
||||||
|
this.$router.push({
|
||||||
|
name: `nominumItem`,
|
||||||
|
query: { id: this.item.uuid }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<template>
|
||||||
|
<article class="operum item">
|
||||||
|
<header>
|
||||||
|
<h1>
|
||||||
|
<a
|
||||||
|
:href="item.url"
|
||||||
|
@click.prevent="onclick"
|
||||||
|
@keyup.enter="onclick"
|
||||||
|
v-html="item.title"
|
||||||
|
/>
|
||||||
|
</h1>
|
||||||
|
</header>
|
||||||
|
</article>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'OperumItem',
|
||||||
|
props: {
|
||||||
|
item: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: () => ({
|
||||||
|
|
||||||
|
}),
|
||||||
|
methods: {
|
||||||
|
onclick () {
|
||||||
|
console.log('clicked on Operum item', this.item)
|
||||||
|
this.$router.push({
|
||||||
|
name: `operuumItem`,
|
||||||
|
query: { id: this.item.uuid }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
+14
-9
@@ -5,15 +5,26 @@
|
|||||||
>
|
>
|
||||||
<h1>Nominum</h1>
|
<h1>Nominum</h1>
|
||||||
<span v-if="!items.length">Loading ...</span>
|
<span v-if="!items.length">Loading ...</span>
|
||||||
|
<div v-else class="item-list">
|
||||||
|
<ul>
|
||||||
|
<li v-for="item in items" v-bind:key="item.url">
|
||||||
|
<NominumItem :item="item" />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { REST } from 'api/rest-axios'
|
import { REST } from 'api/rest-axios'
|
||||||
|
import NominumItem from '../components/Content/NominumItem'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Nominum',
|
name: 'Nominum',
|
||||||
|
components: {
|
||||||
|
NominumItem
|
||||||
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
items: []
|
items: []
|
||||||
|
|
||||||
@@ -24,15 +35,9 @@ export default {
|
|||||||
REST.get(`/indexNominum`, {})
|
REST.get(`/indexNominum`, {})
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
console.log('nominum REST: data', data)
|
console.log('nominum REST: data', data)
|
||||||
// if(data.length){
|
if (data.content.length) {
|
||||||
// commit('setItems',data)
|
this.items = data.content
|
||||||
// // console.log('items.length', this.items.length);
|
}
|
||||||
// if(state.infiniteLoadingState)
|
|
||||||
// state.infiniteLoadingState.loaded()
|
|
||||||
// }else{
|
|
||||||
// if(state.infiniteLoadingState)
|
|
||||||
// state.infiniteLoadingState.complete()
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.warn('Issue with nominum', error)
|
console.warn('Issue with nominum', error)
|
||||||
|
|||||||
+14
-9
@@ -5,15 +5,26 @@
|
|||||||
>
|
>
|
||||||
<h1>Operum</h1>
|
<h1>Operum</h1>
|
||||||
<span v-if="!items.length">Loading ...</span>
|
<span v-if="!items.length">Loading ...</span>
|
||||||
|
<div v-else class="item-list">
|
||||||
|
<ul>
|
||||||
|
<li v-for="item in items" v-bind:key="item.url">
|
||||||
|
<OperumItem :item="item" />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { REST } from 'api/rest-axios'
|
import { REST } from 'api/rest-axios'
|
||||||
|
import OperumItem from '../components/Content/OperumItem'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Operum',
|
name: 'Operum',
|
||||||
|
components: {
|
||||||
|
OperumItem
|
||||||
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
items: []
|
items: []
|
||||||
|
|
||||||
@@ -24,15 +35,9 @@ export default {
|
|||||||
REST.get(`/indexOperum`, {})
|
REST.get(`/indexOperum`, {})
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
console.log('operum REST: data', data)
|
console.log('operum REST: data', data)
|
||||||
// if(data.length){
|
if (data.content.length) {
|
||||||
// commit('setItems',data)
|
this.items = data.content
|
||||||
// // console.log('items.length', this.items.length);
|
}
|
||||||
// if(state.infiniteLoadingState)
|
|
||||||
// state.infiniteLoadingState.loaded()
|
|
||||||
// }else{
|
|
||||||
// if(state.infiniteLoadingState)
|
|
||||||
// state.infiniteLoadingState.complete()
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.warn('Issue with operum', error)
|
console.warn('Issue with operum', error)
|
||||||
|
|||||||
@@ -4,8 +4,10 @@ import Router from 'vue-router'
|
|||||||
import Home from 'pages/Home'
|
import Home from 'pages/Home'
|
||||||
import Corpus from 'pages/Corpus'
|
import Corpus from 'pages/Corpus'
|
||||||
import Nominum from 'pages/Nominum'
|
import Nominum from 'pages/Nominum'
|
||||||
|
import NominumItem from 'components/Content/NominumItem'
|
||||||
import Locorum from 'pages/Locorum'
|
import Locorum from 'pages/Locorum'
|
||||||
import Operum from 'pages/Operum'
|
import Operum from 'pages/Operum'
|
||||||
|
import OperumItem from 'components/Content/OperumItem'
|
||||||
import Bibliographie from 'pages/Bibliographie'
|
import Bibliographie from 'pages/Bibliographie'
|
||||||
|
|
||||||
Vue.use(Router)
|
Vue.use(Router)
|
||||||
@@ -26,6 +28,11 @@ const routes = [
|
|||||||
path: '/nominum',
|
path: '/nominum',
|
||||||
component: Nominum
|
component: Nominum
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'nominumItem',
|
||||||
|
path: '/nominum/:id',
|
||||||
|
component: NominumItem
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'locorum',
|
name: 'locorum',
|
||||||
path: '/locorum',
|
path: '/locorum',
|
||||||
@@ -36,6 +43,11 @@ const routes = [
|
|||||||
path: '/operum',
|
path: '/operum',
|
||||||
component: Operum
|
component: Operum
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'operumItem',
|
||||||
|
path: '/operum/:id',
|
||||||
|
component: OperumItem
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'bibliographie',
|
name: 'bibliographie',
|
||||||
path: '/bibliographie',
|
path: '/bibliographie',
|
||||||
|
|||||||
Reference in New Issue
Block a user