1
0
Fork 0
forked from mirror/pixelfed
pixelfed/resources/assets/js/components/Stories.vue

57 lines
1.1 KiB
Vue
Raw Normal View History

2019-01-12 20:45:12 +00:00
<template>
<div>
2019-02-11 02:20:21 +00:00
<div class="card stories-card">
<div class="card-header bg-white">
<p class="mb-0 d-flex align-items-center justify-content-between">
<span class="text-muted font-weight-bold">Stories</span>
<a class="text-dark small" href="/account/activity">See All</a>
</p>
</div>
<div class="card-body loader text-center" style="height: 120px;">
<div class="spinner-border" role="status">
<span class="sr-only">Loading</span>
2019-02-11 02:20:21 +00:00
</div>
</div>
<div class="card-body pt-2 contents" style="max-height: 120px; overflow-y: scroll;">
<div id="stories">
2019-02-11 02:20:21 +00:00
</div>
2019-01-12 20:45:12 +00:00
</div>
</div>
</div>
</template>
<style type="text/css" scoped>
2019-01-12 20:45:12 +00:00
</style>
<script type="text/javascript">
export default {
data() {
return {
stories: [],
}
},
beforeMount() {
2019-02-11 02:20:21 +00:00
//this.fetchStories();
2019-01-12 20:45:12 +00:00
},
mounted() {
},
methods: {
fetchStories() {
axios.get('/api/v2/stories')
.then(res => {
2019-02-11 02:20:21 +00:00
this.stories = res.data;
$('.stories-card .loader').hide();
var stories = pixelfed.stories.create('stories');
stories.update(this.stories);
2019-01-12 20:45:12 +00:00
});
}
}
}
</script>