After checking some data, it was found that the data was passed from the back end to the front end, and the front end did not handle it well, so an error was reported
Problem: because I want to load a list El table, the required data format is as follows
// Required data format for el-table's :data
[{...} ,{...} ,... ,{...}]
// The format of the data returned by the backend, I returned it directly to :data, which is obviously not correct, it should wrap a []
{...}
Based on this, the way of processing data is not right
// For example, if you deconstruct a res object from the backend, you only need [res] or [res.xx] to solve the problem
// Instance:
getUserByName(name).then(res => {
console(res) // you can look at the format of res in the background, what you really want, and then take it out by way of .xxx
this.userList = [res.data]
})
// I'll go back to el-table here and put :data=userlist to fix it
Read More:
- [Solved] node-xlsx Write excel Error: TypeError: n.indexOf is not a function
- [Solved] Echart Error: Typeerror: axis Getaxesonzeroof is not a function
- [Web Browser] “Uncaught TypeError: object is not a function“
- [Solved] Less Install Error: TypeError: this.getOptions is not a function
- [Vue warn]: Error in v-on handler: “TypeError: Object(…) is not a function“
- [Solved] scss Error: TypeError: this.getOptions is not a function
- [Solved] Syntax Error: TypeError: this.getOptions is not a function
- [Solved] Syntax Error: TypeError: this.getOptions is not a function
- [Solved] Module build failed TypeError this.getOptions is not a function at Object.loader
- [Solved] webpack Package Error: TypeError: this.getOptions is not a function style-loader
- [Solved] Vue Error: Uncaught TypeError: Vue.createApp is not a function
- [Solved] Element Error: Error in render: TypeError: dateStr.match is not a function“
- [Solved] Element form method resetfields() error: vue.runtime.esm.js?2b0e:1888 TypeError: Cannot read properties of undefined (reading ‘indexOf’)
- [Solved] Vue Project Error: Syntax Error: TypeError: this.getOptions is not a function
- Vue form validate error: Error in v-on handler “TypeError Cannot read properties of undefined (reading ‘indexOf‘)
- [Solved] Vue Route Error: Uncaught TypeError: (0 , vue__WEBPACK_IMPORTED_MODULE_42__.defineComponent) is not a function
- [Solved] Error in nextTick: “TypeError: undefined is not iterable
- [Solved] ESLint:TypeError: this.CliEngine is not a constructor
- [Solved] Uncaught (in promise) TypeError: XXX.a is not a constructor
- [Solved] Vue3.2 Error: Object.fromEntries is not a function