diff --git a/shell/components/TabTitle.vue b/shell/components/TabTitle.vue index 0a25e964db..8fa6b9f977 100644 --- a/shell/components/TabTitle.vue +++ b/shell/components/TabTitle.vue @@ -27,10 +27,11 @@ export default { default: true } }, - computed: { - ...mapGetters(['isExplorer', 'currentCluster', 'currentProduct']), + computed: { ...mapGetters(['isExplorer', 'currentCluster', 'currentProduct']) }, - title() { + methods: { + // This isn't a computed prop because it would trigger a recompute when the $slots changed + computeTitle() { if (!this.$slots.default || this.$slots.default.length !== 1 || this.$slots.default[0].tag || (typeof this.$slots.default[0].text !== 'string')) { console.error('The component only supports text as the child.'); // eslint-disable-line no-console @@ -56,13 +57,9 @@ export default { } return breadcrumb; - } - - }, - - methods: { + }, updatePageTitle() { - updatePageTitle(...this.title); + updatePageTitle(...this.computeTitle()); } }, @@ -70,12 +67,6 @@ export default { this.updatePageTitle(); }, - watch: { - title() { - this.updatePageTitle(); - } - }, - // Using the render function instead of