Vue使用mint-ui的Infinite scroll(無線滾動)報錯MutationObserver': parameter 1 is not of type 'Node'." * Failed

在Vue裏面使用mint-ui的Infinite scroll無線滾動,按照配置寫完之後,發現控制檯裏報錯了。如下錯誤信息:

  • Error in directive infinite-scroll inserted hook: “TypeError: Failed to execute ‘observe’ on ‘MutationObserver’: parameter 1 is not of type ‘Node’.”
  • Failed to execute ‘observe’ on ‘MutationObserver’: parameter 1 is not of type ‘Node’.

解決方法是:給使用這個組件的元素設置heightoverflow

<div class="wrap"
   v-infinite-scroll = "loadMore"
   infinite-scroll-disabled = "loading"
   infinite-scroll-distance = "10"
></div>

.wrap {
    height: 100vh;
    overflow-y: auto;
}

然後控制檯就不會報錯了。然而官網並沒有寫這條非常重要的信息。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章