kuan-vue-waterfall icon indicating copy to clipboard operation
kuan-vue-waterfall copied to clipboard

Invalid prop: custom validator check failed for prop "data".

Open Lingouzi opened this issue 3 years ago • 1 comments

vue3 测试代码

<template>
  <div id="app">
    <WaterFall :data="list" width="400px" gap="20px" :delay="false">
      <template #default="item">
        <div class="card">
          {{ item }}
        </div>
      </template>
    </WaterFall>
  </div>
</template>

<script>
  import {ref} from "vue";
  import WaterFall from 'kuan-vue-waterfall'

  export default {
    name: 'App',
    components: {WaterFall},
    setup() {
      const list2 = ref([
        {name: 'hello'}
      ])


      function getNext() {
        console.log('get next...')
        list2.value.push({
          name: 'time ' + new Date().getTime()
        })
      }

      setTimeout(() => {
        getNext()
      }, 2000)

      return {
        list2,
        getNext
      }
    },
    data() {
      return {
        list: [{name: 'name'}]
      }
    }
  }
</script>

Lingouzi avatar Nov 12 '21 02:11 Lingouzi

我也遇到了这个问题,导致后面加载的数据,在item中拿不到,有解决方法吗

leiyangs avatar Mar 28 '23 17:03 leiyangs