This commit is contained in:
syuilo 2018-02-19 18:26:20 +09:00
parent 4705c935ab
commit 0c9a7cf643
8 changed files with 161 additions and 162 deletions

View file

@ -13,19 +13,14 @@
import Vue from 'vue';
export default Vue.extend({
props: {
date: {
type: Date,
required: false
}
},
data() {
return {
fetching: true,
moreFetching: false,
posts: [],
connection: null,
connectionId: null
connectionId: null,
date: null
};
},
computed: {
@ -60,7 +55,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('posts/timeline', {
until_date: this.date ? (this.date as any).getTime() : undefined
until_date: this.date ? this.date.getTime() : undefined
}).then(posts => {
this.fetching = false;
this.posts = posts;
@ -93,6 +88,10 @@ export default Vue.extend({
(this.$refs.timeline as any).focus();
}
}
},
warp(date) {
this.date = date;
this.fetch();
}
}
});