diff options
author | Sukanya Pandey <sukapan1@in.ibm.com> | 2020-12-09 13:44:19 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-12-16 02:16:56 +0300 |
commit | c5c2ae99f6e9b91526ea5896b3029ab8a7480c6f (patch) | |
tree | 5992782ede6c5f457f15a7037c5f71902588845a /src/App.vue | |
parent | f6df801b384118b946bb3b7b3248832ec70cfd0a (diff) | |
download | webui-vue-c5c2ae99f6e9b91526ea5896b3029ab8a7480c6f.tar.xz |
Show asset name in the app header
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: If5394604d6c91b3604eaadb33178376fe6da672c
Diffstat (limited to 'src/App.vue')
-rw-r--r-- | src/App.vue | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/App.vue b/src/App.vue index f6991c46..fc04b70b 100644 --- a/src/App.vue +++ b/src/App.vue @@ -7,9 +7,22 @@ <script> export default { name: 'App', + computed: { + assetTag() { + return this.$store.getters['global/assetTag']; + }, + }, watch: { + assetTag: function (tag) { + if (tag) { + document.title = `${tag} - ${this.$route.meta.title}`; + } + }, $route: function (to) { document.title = to.meta.title || 'Page is missing title'; + if (this.assetTag) { + document.title = `${this.assetTag} - ${to.meta.title}`; + } }, }, created() { |