[Vuejs]-Count child components programmatically

0👍

This could be a solution:

watch: {
    componentsLoaded() {
        let componentCounter = this.$children.filter( i => i.$listeners['component-loaded'] ).length;
        if (this.componentsLoaded.length === componentCounter) this.isLoaded = true;
    }
},

Leave a comment