Answer the question
In order to leave comments, you need to log in
Why doesn't vue-masonry plugin work after ajax request?
After installing the vue-masonry plugin, everything worked fine until it was unnecessary to update the list of articles with an ajax request.
here is the vue.js component code
<template>
<div class="grid-container">
<div v-masonry transition-duration="0.3s" item-selector=".item">
<div v-masonry-tile class="item col-lg-3 col-md-3 col-sm-12 col-xs-12" v-for="article in articles">
test
</div>
</div>
</div>
</template>
<script>
export default{
data : function () {
return {
articles : {}
}
},
mounted : function () {
this.get_articles()
},
methods : {
get_articles : function () {
this.$http.post( window.location.origin + window.location.pathname ).then(response => {
this.articles = response.body;
},response => {});
}
}
}
</script>
Answer the question
In order to leave comments, you need to log in
Judging by the dock, this thing should be called when changing elements: this.$redrawVueMasonry()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question