diff options
| author | Henry Jameson <me@hjkos.com> | 2019-07-05 10:17:44 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2019-07-05 10:17:44 +0300 |
| commit | 8d6750d9c2816e33a0444cd978f94009d8b85d47 (patch) | |
| tree | 853082e4c341cb4d8dd8dfdee3234215d3d9799d /src/components/timeago | |
| parent | 2c2b84d31dbe906b89dfb995394d887af110e04c (diff) | |
eslint --fix --ext .js,.vue src
Diffstat (limited to 'src/components/timeago')
| -rw-r--r-- | src/components/timeago/timeago.vue | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/components/timeago/timeago.vue b/src/components/timeago/timeago.vue index 3f185a2d..6df0524d 100644 --- a/src/components/timeago/timeago.vue +++ b/src/components/timeago/timeago.vue @@ -1,5 +1,8 @@ <template> - <time :datetime="time" :title="localeDateString"> + <time + :datetime="time" + :title="localeDateString" + > {{ $t(relativeTime.key, [relativeTime.num]) }} </time> </template> @@ -16,12 +19,6 @@ export default { interval: null } }, - created () { - this.refreshRelativeTimeObject() - }, - destroyed () { - clearTimeout(this.interval) - }, computed: { localeDateString () { return typeof this.time === 'string' @@ -29,6 +26,12 @@ export default { : this.time.toLocaleString() } }, + created () { + this.refreshRelativeTimeObject() + }, + destroyed () { + clearTimeout(this.interval) + }, methods: { refreshRelativeTimeObject () { const nowThreshold = typeof this.nowThreshold === 'number' ? this.nowThreshold : 1 @@ -45,4 +48,4 @@ export default { } } } -</script>
\ No newline at end of file +</script> |
