Fixes masonry initialization error when switching view modes.
This commit is contained in:
parent
d17fcb7532
commit
e2b91b72e9
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue