VUE前端報(bào)錯(cuò)
Error in updated hook: "TypeError: this.$el.querySelectorAll is not a function"
TypeError: data.reduce is not a function
出錯(cuò)原因:data里面定義了下面的字段,從props里面拷貝過(guò)來(lái),使用了default()函數(shù)
newXXXList: {
? ? ? ? default() {
? ? ? ? ? return [];
? ? ? ? }
? ? ? },
解決辦法,使用newXXXList:[]定義就可以了。