Add tag timeline view.
This commit is contained in:
parent
3eaaa4c16d
commit
9abfcb34ef
9 changed files with 82 additions and 10 deletions
26
src/components/tag_timeline/tag_timeline.js
Normal file
26
src/components/tag_timeline/tag_timeline.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
import Timeline from '../timeline/timeline.vue'
|
||||
|
||||
const TagTimeline = {
|
||||
created () {
|
||||
this.$store.commit('clearTimeline', { timeline: 'tag' })
|
||||
this.$store.dispatch('startFetching', { 'tag': this.tag })
|
||||
},
|
||||
components: {
|
||||
Timeline
|
||||
},
|
||||
computed: {
|
||||
tag () { return this.$route.params.tag },
|
||||
timeline () { return this.$store.state.statuses.timelines.tag }
|
||||
},
|
||||
watch: {
|
||||
tag () {
|
||||
this.$store.commit('clearTimeline', { timeline: 'tag' })
|
||||
this.$store.dispatch('startFetching', { 'tag': this.tag })
|
||||
}
|
||||
},
|
||||
destroyed () {
|
||||
this.$store.dispatch('stopFetching', 'tag')
|
||||
}
|
||||
}
|
||||
|
||||
export default TagTimeline
|
12
src/components/tag_timeline/tag_timeline.js~
Normal file
12
src/components/tag_timeline/tag_timeline.js~
Normal file
|
@ -0,0 +1,12 @@
|
|||
import Timeline from '../timeline/timeline.vue'
|
||||
|
||||
const TagTimeline = {
|
||||
components: {
|
||||
Timeline
|
||||
},
|
||||
computed: {
|
||||
timeline () { return this.$store.state.statuses.timelines.tag }
|
||||
}
|
||||
};
|
||||
|
||||
export default TagTimeline
|
5
src/components/tag_timeline/tag_timeline.vue
Normal file
5
src/components/tag_timeline/tag_timeline.vue
Normal file
|
@ -0,0 +1,5 @@
|
|||
<template>
|
||||
<Timeline :title="tag" :timeline="timeline" :timeline-name="'tag'" :tag="tag" />
|
||||
</template>
|
||||
|
||||
<script src='./tag_timeline.js'></script>
|
5
src/components/tag_timeline/tag_timeline.vue~
Normal file
5
src/components/tag_timeline/tag_timeline.vue~
Normal file
|
@ -0,0 +1,5 @@
|
|||
<template>
|
||||
<div> timleinei </div>
|
||||
</template>
|
||||
|
||||
<script src='./tag_timeline.js'></script>
|
|
@ -8,7 +8,8 @@ const Timeline = {
|
|||
'timeline',
|
||||
'timelineName',
|
||||
'title',
|
||||
'userId'
|
||||
'userId',
|
||||
'tag'
|
||||
],
|
||||
computed: {
|
||||
timelineError () { return this.$store.state.statuses.error },
|
||||
|
@ -39,7 +40,8 @@ const Timeline = {
|
|||
credentials,
|
||||
timeline: this.timelineName,
|
||||
showImmediately,
|
||||
userId: this.userId
|
||||
userId: this.userId,
|
||||
tag: this.tag
|
||||
})
|
||||
|
||||
// don't fetch followers for public, friend, twkn
|
||||
|
@ -62,7 +64,8 @@ const Timeline = {
|
|||
timeline: this.timelineName,
|
||||
older: true,
|
||||
showImmediately: true,
|
||||
userId: this.userId
|
||||
userId: this.userId,
|
||||
tag: this.tag
|
||||
}).then(() => store.commit('setLoading', { timeline: this.timelineName, value: false }))
|
||||
},
|
||||
fetchFollowers () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue