VueJS get data as object
I think what you are looking for is to return the whole data object, like this:
log() {
console.log(this.$data);
}
You can access the current component's data object using this.$data
.
Reference: Link
So the log function should be like:
log() {
console.log(this.$data.a);
console.log(this.$data.b);
console.log(this.$data.foo);
}