vue-masonry icon indicating copy to clipboard operation
vue-masonry copied to clipboard

Suggestion: Use directive binding to pass masonry options

Open wonyeouuu opened this issue 7 years ago • 3 comments

Hi @shershen08 , this is a good module and I really appreciate your good work.

I think this module can be further improved with passing masonry options with vue directive binding. With the current implementation, options passed into masonry can only be interpreted as strings (e.g. setting :gutter="10" on the template will not work since it's interpreted as '10' but not 10).

I've forked your repo into my own repository and probably figured out how to achieve this. However, this will cause breaking changes in the original API, for example:

// .vue
export default {
  data () {
    return {
      config: { itemSelector: '.item', gutter: 10 },
    }
  },
}

// template
<div v-masonry='config' />

How do you think? Thanks!

wonyeouuu avatar Jun 04 '18 16:06 wonyeouuu

yes, I know about this option to pass props @wonyeouuu thank's for bringing it in

I was thinking of creating a new major release version say 1.0.0 that would include this and several other changes:

  • those won't be needed https://github.com/shershen08/vue-masonry/blob/master/src/masonry.plugin.js#L23
  • also add improvements to #51, #47 etc

By doing this users of the current 0.x version won't be affected that bad (in case of proper version set in package.json)

I'll ping you as soon as I have it

shershen08 avatar Jun 06 '18 14:06 shershen08

any updates?

LepuavkoDV avatar Aug 15 '19 12:08 LepuavkoDV

Yep?

ux-engineer avatar Jul 18 '21 20:07 ux-engineer