shershen08 / vue-masonry

💠 Vue.js directive for masonry blocks layouting ✅
MIT License
677 stars 81 forks source link

Masonry tile inside child component / redraw not working #55

Closed pauljakobwhite closed 6 years ago

pauljakobwhite commented 6 years ago

Hello,

I am trying to nest the masonry tile/masonry item inside of a component that is a child of the container. i.e:

Container Component: ServerNodes

<div class="servers" v-masonry="" transition-duration="0.1s" item-selector=".server" fit-width="true">
    <ServerNode v-for="(server,index) in $store.state.Servers.servers" :key="server.id" v-masonry-tile=""></ServerNode>
</div>

Child Component: ServerNode

<div class="server">
    <span @click="toggleExpansion()">{{server.name}}</span>
</div>

Essentially, when you click the child component servernode masonry item, it expands the size of the of that masonry item to view more details and fires the redraw function so everything adjusts accordingly. This works fine if the item is not inside a component, but when inside the component the redraw doesnt seem to recognize the size of the item has changed.

Any thoughts?

pauljakobwhite commented 6 years ago

Closed issue, it was simply a timing issue, the expanded size wasn't executing before the redraw fired