Add page titles using route meta data
Adding the page title using the route assures that each page has a set
title.
Signed-off-by: Derick Montague <derick.montague@ibm.com>
Change-Id: I75cdd39a1ccdfe4ac9757886e22f016188f42360
diff --git a/src/App.vue b/src/App.vue
index 5667495..d5b4932 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -10,6 +10,11 @@
<script>
export default {
- name: "App"
+ name: "App",
+ watch: {
+ $route: function(to) {
+ document.title = to.meta.title || "Page is Missing Title";
+ }
+ }
};
</script>