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 () {
|
||||
const dt = moment(this.value)
|
||||
return {
|
||||
fromNow: dt.fromNow(),
|
||||
actual: dt.format('LLLL'),
|
||||
fromNow: moment(this.value).fromNow(),
|
||||
intervalId: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
actual () {
|
||||
return moment(this.value).format('LLLL')
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.intervalId = setInterval(this.updateFromNow, this.interval)
|
||||
this.$watch('value', this.updateFromNow)
|
||||
|
|
Loading…
Reference in New Issue
Block a user