deleteProduct(idx, rows,id){
this.$confirm("?", {
confirmButtonText: "",
cancelButtonText: "",
type: "warning"
}).then(() => {
axios({
method: "post",
url: "/product/delProductById",
headers: {
"Content-Type": "application/json; charset=UTF-8",
},
data:{
id:id
}
}).then((response) => {
console.log(response)
if (response.data.resultInfo.type===1){
this.$message({
type: "success",
message: "!"
});
console.log(typeof rows)
console.log(rows)
rows.splice(idx, 1)
}else{
this.$message({
type: "info",
message: "!"
});
}
}).catch((error) => {
console.log(error);
this.$message({
type: "info",
message: "!"
});
})
because console.log (rows) is {_ _ ob__: Observer}, it will report the fault of .splice is not a function. If you search it, it is said to be asynchronous. How to solve the problem?