fixed prev next links in article page for new route using id
This commit is contained in:
parent
d4957ad19a
commit
488447fbe1
File diff suppressed because one or more lines are too long
|
@ -10,7 +10,7 @@
|
||||||
v-if="prevnext.prev"
|
v-if="prevnext.prev"
|
||||||
:href="prevnext.prev.view_node"
|
:href="prevnext.prev.view_node"
|
||||||
v-html="prevnext.prev.title"
|
v-html="prevnext.prev.title"
|
||||||
@click.prevent="onPrevNext(prevnext.prev.view_node)"
|
@click.prevent="onPrevNext(prevnext.prev)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
v-if="prevnext.next"
|
v-if="prevnext.next"
|
||||||
:href="prevnext.next.view_node"
|
:href="prevnext.next.view_node"
|
||||||
v-html="prevnext.next.title"
|
v-html="prevnext.next.title"
|
||||||
@click.prevent="onPrevNext(prevnext.next.view_node)"
|
@click.prevent="onPrevNext(prevnext.next)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
v-if="prevnext.prev"
|
v-if="prevnext.prev"
|
||||||
:href="prevnext.prev.view_node"
|
:href="prevnext.prev.view_node"
|
||||||
v-html="prevnext.prev.title"
|
v-html="prevnext.prev.title"
|
||||||
@click.prevent="onPrevNext(prevnext.prev.view_node)"
|
@click.prevent="onPrevNext(prevnext.prev)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -106,7 +106,7 @@
|
||||||
v-if="prevnext.next"
|
v-if="prevnext.next"
|
||||||
:href="prevnext.next.view_node"
|
:href="prevnext.next.view_node"
|
||||||
v-html="prevnext.next.title"
|
v-html="prevnext.next.title"
|
||||||
@click.prevent="onPrevNext(prevnext.next.view_node)"
|
@click.prevent="onPrevNext(prevnext.next)"
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -284,14 +284,14 @@ export default {
|
||||||
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
onPrevNext(a){
|
onPrevNext(pn){
|
||||||
console.log('clicked on prev/next; a', a);
|
console.log('clicked on prev/next; prevnext', pn);
|
||||||
let alias = a.replace(/^\/\D{2,3}\/blabla\//g, '')
|
let alias = pn.view_node.replace(/^\/\D{2,3}\/blabla\//g, '')
|
||||||
console.log('alias', alias);
|
console.log('alias', alias);
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name:`article`,
|
name:`article`,
|
||||||
params: { alias:alias }
|
params: { alias:alias, id: pn.nid }
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setLightboxIndex(index) {
|
setLightboxIndex(index) {
|
||||||
|
|
Loading…
Reference in New Issue