vue-masonry
vue-masonry copied to clipboard
Suggestion: Use directive binding to pass masonry options
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!
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
any updates?
Yep?