Currently, I am integrating moment.js into a Vue component but I am facing an issue where certain changes are not being reflected in vue devtools.
Here is an example of my code:
export default {
data() {
return {
moment: moment(),
};
},
methods: {
prevMonth() {
this.moment.subtract(7, 'days');
},
nextMonth() {
this.moment.add(7, 'days');
}
}
};
I suspect that the problem lies in calling a method on my moment data property rather than directly manipulating it like a number. For instance, when I use a similar approach with a count variable, it works seamlessly and updates in vue devtools:
export default {
data() {
return {
count: 0,
};
},
methods: {
prevMonth() {
this.count--;
},
nextMonth() {
this.count++;
}
}
};
Is there a way to refresh or display these changes in vue devtools?