Improve build times
* Fix bulma/buefy being imported many (many !!!) times * Remove javascript-time-ago because date-fns pretty much does the same thing * Make sure languages are loaded asynchronously Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -5,11 +5,17 @@
|
||||
>
|
||||
<div class="title-info-wrapper">
|
||||
<p class="post-minimalist-title">{{ post.title }}</p>
|
||||
<small class="has-text-grey">{{ $timeAgo.format(new Date(post.insertedAt)) }}</small>
|
||||
<small class="has-text-grey">{{
|
||||
formatDistanceToNow(new Date(post.publishAt || post.insertedAt), {
|
||||
locale: $dateFnsLocale,
|
||||
addSuffix: true,
|
||||
})
|
||||
}}</small>
|
||||
</div>
|
||||
</router-link>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { formatDistanceToNow } from "date-fns";
|
||||
import { Component, Prop, Vue } from "vue-property-decorator";
|
||||
import RouteName from "../../router/name";
|
||||
import { IPost } from "../../types/post.model";
|
||||
@@ -19,6 +25,8 @@ export default class PostListItem extends Vue {
|
||||
@Prop({ required: true, type: Object }) post!: IPost;
|
||||
|
||||
RouteName = RouteName;
|
||||
|
||||
formatDistanceToNow = formatDistanceToNow;
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user