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)
我代码中没有用到indexOf这个方法,但是却报错了,然后页面显示不出来了,有大神知道这是什么错误吗,多谢啦
报错很明显了,
TypeError: data.indexOf is not a function
表示这不是一个方法根据查询MDN:Array的indexOf,String的indexOf 两种方法,表示
indexOf
只有在Array
原型和String
原型上才能使用。所以请你检查一下你的data是不是属于
Array
或者是String