Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue when update waterfall items #49

Open
tomdong opened this issue Oct 2, 2018 · 0 comments
Open

Performance issue when update waterfall items #49

tomdong opened this issue Oct 2, 2018 · 0 comments

Comments

@tomdong
Copy link

tomdong commented Oct 2, 2018

I'm using this component to build a gallery, it works well.
here is how I'm using the component:

  <waterfall
    class="waterfall-view"
    :line-gap="cardSizeInfo.lineGap"
    :min-line-gap="cardSizeInfo.minLineGap"
    :max-line-gap="cardSizeInfo.maxLineGap"
    align="center"
    :watch="itemList"
    ref="waterfallGallery"
    :style="minHeight">
    <waterfall-slot :style='waterfallSlotStyle'
      v-for="(imgData, index) in itemList"
      :width="imgData.width"
      :height="imgData.height"
      :order="index"
      :key="index">
      <card-item
        :itemData="imgData"
        :key="index">
      </card-item>
    </waterfall-slot>

(the component card-item is my component to display image, I also tried removing the image from the card-item component, but still see the issue)

Sometimes, there might be too many items in the waterfall component.
I found it will be very slow when the previous item-collection was big.

For example, if there has been 10,000 items in the waterfall.
If I want to clear the waterfall by setting the item-collection to empty, it will take more than 25s to clear the waterfall.
(I'm using an i7 cpu on windows).

Any suggestion or comments?

Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant