monteecristoo’s blog

https://twitter.com/irakaarozo

Vue-infinite-loading error: [Vue warn]: Property or method "recommend" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.

Vue-infinite-loadingでv-forのpropertyにエラーが出る場合

 

 <p v-for="(recommend, key) in list">

  <div id="recommend">

    <span v-text="recommend"></span>

  </div>

</p>

<infinite-loading :on-infinite="onInfinite" ref="infiniteLoading"></infinite-loading>

余分な<div>があるとエラーが出る。

 

解決方法:

 <p v-for="(recommend, key) in list">

   <span v-text="recommend"></span>

</p>

<infinite-loading :on-infinite="onInfinite" ref="infiniteLoading"></infinite-loading>