Vue console reported an error

TypeError: data.indexOf is not a function
    at TableStore.module.exports.TableStore.updateCurrentRow (element-ui.common.js?ccbf:11270)
    at TableStore.setData (element-ui.common.js?ccbf:10762)
    at TableStore.module.exports.TableStore.commit (element-ui.common.js?ccbf:11286)
    at VueComponent.handler (element-ui.common.js?ccbf:10481)
    at VueComponent.Vue.$watch (vue.esm.js?efeb:3613)
    at createWatcher (vue.esm.js?efeb:3571)
    at initWatch (vue.esm.js?efeb:3553)
    at initState (vue.esm.js?efeb:3317)
    at VueComponent.Vue._init (vue.esm.js?efeb:4628)
    at new VueComponent (vue.esm.js?efeb:4798)

I did not use the indexOf method in my code, but I reported an error, and then the page could not be displayed. Does any god know what this is wrong? thank you

Jul.12,2021

the error is obvious. TypeError: data.indexOf is not a function indicates that this is not a method

based on the query indexOf of MDN: String indexOf , means indexOf can only be used on Array prototypes and String prototypes.

so please check whether your data belongs to Array or String

.

String/Array has the indexOf method, indicating that the type error (TypeError), naturally means that data is neither a string nor an array. Take a look at what data is at your breakpoint.


data.indexOf is not a function
clearly understand what is said upstairs, but it is not necessarily a variable data to see which js the error message is in, and then debug to see what variable walks into the test

.
Menu