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

Made it possible to add non-grid items under the isotope element. #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zArubaru
Copy link

@zArubaru zArubaru commented Nov 16, 2017

Added a change in src/vue_isotope.js that makes it possible to add non-grid items under the isotope element. For example:

<isotope :item-selector="'RL-IsoGallery__tile'"
         :options="isotopeOptions"
         :list="tiles">
  <div v-for="tile in tiles"
       :key="tile.id">
    <img :src="tile.src" :alt="tile.alt">
  </div>
  <div :key="'$ignore'" class="RL-IsoGallery__gutter"></div>
</isotope>

<script>
isotopeOptions: {
  itemSelector: '.RL-IsoGallery__tile',
  percentPosition: true,
  masonry: {
    gutter: '.RL-IsoGallery__gutter',
  },
},
</script>

Now isotope doesn't forcibly add the item-selector class to the gutter-sizer div, if the :key="'$ignore'".

Before this change, I would either have to add a :key to the gutter-sizer div, which would force the item-selector class, or leave it without a :key, which would lead to the error: Warning template error: isotope children must be keyed. Please rebuild dist/*as you see fit.

I was also working on a more complex fix for this, but this took only into account masonry's gutter and columnWidth, but it might be useful for you later on so check it out:
zArubaru@5fcbbca#diff-c0f7674dbe53fdbdfb7d9ff2640ec489

... which made the syntax like this:

<div :gutter="'RL-IsoGallery__gutter'"></div>
<div :column-width="'RL-IsoGallery__column-width'"></div>

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.

1 participant