Watch for route changes
This commit is contained in:
parent
fc30b58069
commit
429170737f
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="channel--name" @click="select(channel)">
|
<div class="channel--name">
|
||||||
<router-link :to='"/channel/" + channel.uid'>
|
<router-link :to='"/channel/" + channel.uid'>
|
||||||
{{ channel.name }}
|
{{ channel.name }}
|
||||||
<span :class="{ tag: true, 'is-success': channel.unread > 0}">{{ channel.unread }}</span>
|
<span :class="{ tag: true, 'is-success': channel.unread > 0}">{{ channel.unread }}</span>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@
|
||||||
<button class="button" @click="openFeedFollower">Add feed</button>
|
<button class="button" @click="openFeedFollower">Add feed</button>
|
||||||
<new-post class="mt-20"></new-post>
|
<new-post class="mt-20"></new-post>
|
||||||
<h1>{{ channel.name }}</h1>
|
<h1>{{ channel.name }}</h1>
|
||||||
<Timeline style="margin-top:20px" :timeline="this.$store.state.timeline" :channel="channel" @getPage="getPage"></Timeline>
|
<Timeline style="margin-top:20px" :timeline="this.$store.state.timeline" :channel="channel"
|
||||||
|
@getPage="getPage"></Timeline>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column"></div>
|
<div class="column"></div>
|
||||||
|
|
@ -75,6 +76,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
'$route'(to, from) {
|
||||||
|
this.$store.dispatch('fetchChannels')
|
||||||
|
this.$store.dispatch('fetchTimeline', {uid: to.params.uid})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.$store.state.logged_in) {
|
if (this.$store.state.logged_in) {
|
||||||
this.$store.dispatch('fetchChannels')
|
this.$store.dispatch('fetchChannels')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user