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

Fix: Accept ID as value to allow multiple instances #89

Merged
merged 1 commit into from
Aug 19, 2019
Merged

Fix: Accept ID as value to allow multiple instances #89

merged 1 commit into from
Aug 19, 2019

Conversation

benjamindedonder
Copy link

This fixes #59

new usage:

<div v-masonry="masonryId" transition-duration="0.3s" item-selector=".item">
  <div v-masonry-tile="masonryId" class="item" v-for="(item, index) in blocks">
    <!-- block item markup -->
  </div>
</div>
export default {
  data: () => ({
    masonryId: 'masonry-grid-1'
  })
}
this.$redrawVueMasonry('masonry-grid-1')

@shershen08
Copy link
Owner

Thanks for the input, I'll check that soon

@benjamindedonder
Copy link
Author

No problem, thank you for bringing Masonry to Vue. :)

This fix is also possible using an attribute instead of taking the value from bindings. Depends on what you prefer.

@benjamindedonder
Copy link
Author

If you need any help maintaining this project, I would love to do so.

@shershen08 shershen08 merged commit 4cbf1ec into shershen08:master Aug 19, 2019
@shershen08
Copy link
Owner

Thanks for your contribution @benjamindedonder

@kirkbushell
Copy link

Are we sure this works? I've defined the ID and tried to get it to work numerous times, all to no avail.

@kirkbushell
Copy link

In fact every time I define an ID, the library bugs out.

@benjamindedonder
Copy link
Author

I mean to remember this was working for me. I have no idea about how you are using it of course, so I can't really help you out.

But I ended up simply using the Masonry library directly in my application which worked best for me. After all, this plugin simply wraps this library into a Vue Directive.

@fladens
Copy link

fladens commented May 31, 2020

I had the same problem as @kirkbushell but after I looked into the code I saw that the id needs to be set on the v-masonry and the v-masonry-tile (so that events get send correctly). After adding it to both, everything worked as expected for me.

I think it would be good to add that to the README, right now it doesn't say it anywhere.

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

Successfully merging this pull request may close these issues.

Multiple instances issue
4 participants