Giter Club home page Giter Club logo

Comments (8)

AwesomeDevin avatar AwesomeDevin commented on July 29, 2024

能提供一个demo吗,我试了一下之前写的demo,不会有这个问题

from vue-waterfall2.

huhan-123 avatar huhan-123 commented on July 29, 2024
<template>
  <div >
      <waterfall :col="4" :data="images" :gutterWidth="7" ref="waterfallRef" class="w-full">
        <div class="mb-2" v-for="(item, index) in images" :key="index">
          <img v-if="item.imageUrl" :src="item.imageUrl"
               class="w-full h-auto block object-cover rounded-lg cursor-pointer"/>
        </div>
      </waterfall>
  </div>
</template>

<script setup>

import { ref} from "vue";

const images = ref([
  {
    "imageId": "....",
    "imageUrl": "...."
  },
  .....
])

const waterfallRef = ref(null)
</script>

from vue-waterfall2.

huhan-123 avatar huhan-123 commented on July 29, 2024

写了个demo,同样的代码,在我实际的项目中行为是拖动窗口,有重复图片会添加到瀑布流中,但是在demo中行为是拖动窗口,瀑布流不会重新渲染

from vue-waterfall2.

AwesomeDevin avatar AwesomeDevin commented on July 29, 2024

项目中有监听resize吗

from vue-waterfall2.

huhan-123 avatar huhan-123 commented on July 29, 2024

有,但是我的监听函数并没有修改瀑布流的数据或者布局

from vue-waterfall2.

AwesomeDevin avatar AwesomeDevin commented on July 29, 2024

看一下data的赋值方式?是不是resize修改了data, 这时瀑布流数据就重复了

from vue-waterfall2.

huhan-123 avatar huhan-123 commented on July 29, 2024

我用vue插件看数据是没有重复的

from vue-waterfall2.

AwesomeDevin avatar AwesomeDevin commented on July 29, 2024

拼接数据的时候看一下你的赋值方式?使用concat赋值试试, #115 有可能类似这个问题

from vue-waterfall2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.