我的vue-js应用程序中包含以下代码:
methods: {
onSubmit() {
ApiService.post('auth/sign_in', {
email: this.email,
password: this.password,
})
.then((res) => {
saveHeaderToCookie(res.headers);
this.$router.push({ name: 'about' });
})
.catch((res) => {
this.message = res.response.data.errors[0];
this.msgStatus = true;
this.msgType = 'error';
});
},
}
Run Code Online (Sandbox Code Playgroud)
在运行Es-lint时。this.message = res.response.data.errors[0];在此行出现一个错误,提示“使用数组分解”(首选分解)。什么是数组销毁以及如何执行此操作?请为此提供一个概念。我已经研究过,但无法弄清楚