Refresh the relative time object for a Timeago component if the time changes
This commit is contained in:
parent
232cc72df8
commit
b70d50407c
@ -34,6 +34,13 @@ export default {
|
|||||||
unmounted () {
|
unmounted () {
|
||||||
clearTimeout(this.interval)
|
clearTimeout(this.interval)
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
time (newVal, oldVal) {
|
||||||
|
if (oldVal !== newVal) {
|
||||||
|
this.refreshRelativeTimeObject()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
refreshRelativeTimeObject () {
|
refreshRelativeTimeObject () {
|
||||||
const nowThreshold = typeof this.nowThreshold === 'number' ? this.nowThreshold : 1
|
const nowThreshold = typeof this.nowThreshold === 'number' ? this.nowThreshold : 1
|
||||||
|
Loading…
Reference in New Issue
Block a user