Is there a way to utilize object destructuring in my Vue component data? Here is my current code:
data: () => ({
descricao: '',
perfilBase: null,
anotherField: '',
otherOne: false
}),
mounted () {
this.descricao = this.$route.query.descricao
this.perfilBase = this.$route.query.perfilBase
}
Could I achieve the same result using object destructuring in the mounted hook like this?
mounted () {
{ this.descricao, this.perfilBase } = ...this.$route.query
}