summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/components/Global/PageTitle.vue15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/components/Global/PageTitle.vue b/src/components/Global/PageTitle.vue
index 45c75edb..e195d1ac 100644
--- a/src/components/Global/PageTitle.vue
+++ b/src/components/Global/PageTitle.vue
@@ -6,6 +6,7 @@
</template>
<script>
+import i18n from '@/i18n';
export default {
name: 'PageTitle',
props: {
@@ -19,6 +20,20 @@ export default {
title: this.$route.meta.title,
};
},
+ created() {
+ var title = this.$route.name;
+ var i = 1;
+ while (i < this.$route.name.split('-').length) {
+ var index = title.search('-');
+ title = title.replace(
+ '-' + title.charAt(index + 1),
+ title.charAt(index + 1).toUpperCase()
+ );
+ i++;
+ }
+ this.title = i18n.t('appPageTitle.' + title);
+ document.title = this.title;
+ },
};
</script>