Update tooltip on date changed
Bound long date to computed property (addresses #15 )
This commit is contained in:
parent
650bda6bc5
commit
67cdd5a9b0
@ -20,13 +20,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
const dt = moment(this.value)
|
|
||||||
return {
|
return {
|
||||||
fromNow: dt.fromNow(),
|
fromNow: moment(this.value).fromNow(),
|
||||||
actual: dt.format('LLLL'),
|
|
||||||
intervalId: null
|
intervalId: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
actual () {
|
||||||
|
return moment(this.value).format('LLLL')
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.intervalId = setInterval(this.updateFromNow, this.interval)
|
this.intervalId = setInterval(this.updateFromNow, this.interval)
|
||||||
this.$watch('value', this.updateFromNow)
|
this.$watch('value', this.updateFromNow)
|
||||||
|
Loading…
Reference in New Issue
Block a user