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