How can I use object destructuring to my Vue component data? This is my actual code:
data: () => ({
descricao: '',
perfilBase: null,
anotherField: '',
otherOne: false
}),
mounted () {
this.descricao = this.$route.query.descricao
this.perfilBase = this.$route.query.perfilBase
}
How can I do it like this? Is it possible?
mounted () {
{ this.descricao, this.perfilBase } = ...this.$route.query
}