Skip to content

Commit

Permalink
fix: use check slot pattern in side nav (#1092)
Browse files Browse the repository at this point in the history
Co-authored-by: Lee Chase <lee.chase@uk.ibm.com>
  • Loading branch information
lee-chase and lee-chase committed Dec 11, 2020
1 parent 91adefb commit b6d1287
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core/src/components/cv-ui-shell/cv-side-nav-link.vue
Expand Up @@ -36,11 +36,19 @@ export default {
},
data() {
return {
hasNavIcon: this.$slots['nav-icon'],
hasNavIcon: false,
};
},
mounted() {
this.checkSlots();
},
updated() {
this.hasNavIcon = !!this.$slots['nav-icon'];
this.checkSlots();
},
methods: {
checkSlots() {
this.hasNavIcon = !!this.$slots['nav-icon'];
},
},
};
</script>

0 comments on commit b6d1287

Please sign in to comment.