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這個方法,但是卻報錯了,然后頁面顯示不出來了,有大神知道這是什么錯誤嗎,多謝啦
1 回答

慕森卡
TA貢獻1806條經(jīng)驗 獲得超8個贊
報錯很明顯了,TypeError: data.indexOf is not a function
表示這不是一個方法
根據(jù)查詢MDN:Array的indexOf,String的indexOf 兩種方法,表示indexOf
只有在Array
原型和String
原型上才能使用。
所以請你檢查一下你的data是不是屬于Array
或者是String
添加回答
舉報
0/150
提交
取消