亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue 控制臺報錯

vue 控制臺報錯

陪伴而非守候 2018-10-24 12:25:23
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條經驗 獲得超8個贊

報錯很明顯了,TypeError: data.indexOf is not a function表示這不是一個方法

根據查詢MDN:Array的indexOf,String的indexOf 兩種方法,表示indexOf只有在Array原型和String原型上才能使用。

所以請你檢查一下你的data是不是屬于Array或者是String


查看完整回答
反對 回復 2018-10-24
  • 1 回答
  • 0 關注
  • 1565 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號