Human date component
This commit is contained in:
parent
d0a9873a07
commit
7808d14a49
|
@ -0,0 +1,8 @@
|
||||||
|
<template>
|
||||||
|
<time :datetime="date" :title="date | moment">{{ date | ago }}</time>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: ['date']
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<a class="author">{{ user.username }}</a>
|
<a class="author">{{ user.username }}</a>
|
||||||
<div class="metadata">
|
<div class="metadata">
|
||||||
<div class="date">{{ date | ago }}</div>
|
<div class="date"><human-date :date="date"></human-date></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text" v-html="comment"></div>
|
<div class="text" v-html="comment"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
import Vue from 'vue'
|
||||||
|
|
||||||
|
import HumanDate from '@/components/common/HumanDate'
|
||||||
|
|
||||||
|
Vue.component('human-date', HumanDate)
|
||||||
|
|
||||||
|
export default {}
|
|
@ -14,6 +14,7 @@ import store from './store'
|
||||||
import config from './config'
|
import config from './config'
|
||||||
import { sync } from 'vuex-router-sync'
|
import { sync } from 'vuex-router-sync'
|
||||||
import filters from '@/filters' // eslint-disable-line
|
import filters from '@/filters' // eslint-disable-line
|
||||||
|
import globals from '@/components/globals' // eslint-disable-line
|
||||||
|
|
||||||
sync(store, router)
|
sync(store, router)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue