3👍
✅
The data property is design for storing variables, not invoking functions or adding logic like you’re trying to do.
Try computed property:
computed: {
tomorrow() {
const d = new Date()
d.setDate(d.getDate() + 1)
return d
}
}
And then in your template you can do {{ tomorrow }}
or in your vue component this.tomorrow
Source:stackexchange.com