The ele.me component used by vue, delete the occurrence of {_ _ ob__: Observer}

clipboard.png

        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?

Mar.02,2021

thanks to a reminder, it's really the data, which is an object, not an array.


has the respondent solved this problem? I want an array, but I always type out objects with observer

.
Menu