Fixes masonry initialization error when switching view modes.

This commit is contained in:
mateuswetah 2022-07-29 12:16:48 -03:00
parent d17fcb7532
commit e2b91b72e9
2 changed files with 3 additions and 2 deletions

View File

@ -118,8 +118,9 @@ export default {
watch: { watch: {
isLoading: { isLoading: {
handler() { handler() {
if (this.items && this.items.length > 0) { if (this.items && this.items.length > 0 && !this.isLoading) {
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.items.length)
if (this.masonry !== false) if (this.masonry !== false)
this.masonry.destroy(); this.masonry.destroy();

View File

@ -158,7 +158,7 @@ export default {
watch: { watch: {
isLoading: { isLoading: {
handler() { handler() {
if (this.items && this.items.length > 0) { if (this.items && this.items.length > 0 && !this.isLoading) {
this.$nextTick(() => { this.$nextTick(() => {
if (this.masonry !== false) if (this.masonry !== false)
this.masonry.destroy(); this.masonry.destroy();