2👍
Try using a watch:
data: {
"onedaytours": null
},
ready: function(){
this.$watch("onedaytours", function (newValue, oldValue) {
this.$nextTick(function () {
$(".flipblock").flip();
});
});
this.fetchOneDayTours();
},
This assumes that .flip() is safe to call on elements multiple times. Otherwise, you’ll either need to do something like mark the elements that have been initialized so you can skip them, remove flip from all elements and then apply to all again, etc.
The $nextTick
call is needed to allow the DOM to update (when Vue is using async batch updates).
- [Vuejs]-Javascript if statement inside return
- [Vuejs]-VUE : state variable undefined when accessing it in data() section through computed mapGetters()
Source:stackexchange.com