dynamic document title
This commit is contained in:
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -1,13 +1,13 @@
|
||||
import { Home, TestLoader, TestEmpty, TestHeader } from "./app.modules";
|
||||
|
||||
export let routes = [
|
||||
{ path: "", component: Home, name: "home" },
|
||||
{ path: "/production" },
|
||||
{ path: "/tools" },
|
||||
{ path: "/report" },
|
||||
{ path: "/alarms" },
|
||||
{ path: "/maintenance" },
|
||||
{ path: "/utility" },
|
||||
{ path: "", component: Home, name: "home", meta: { title: "Step - Dashboard" } },
|
||||
{ path: "/production", meta: { title: "Step - Production" } },
|
||||
{ path: "/tools", meta: { title: "Step - Tools" } },
|
||||
{ path: "/report", meta: { title: "Step - Reports" } },
|
||||
{ path: "/alarms", meta: { title: "Step - Alarms" } },
|
||||
{ path: "/maintenance", meta: { title: "Step - Maintenance" } },
|
||||
{ path: "/utility", meta: { title: "Step - Utility" } },
|
||||
{ path: "/scada" },
|
||||
{ path: "/test/loader", component: TestLoader, name: "testloader" },
|
||||
{ path: "/test/empty", component: TestEmpty, name: "testloader" },
|
||||
|
||||
@@ -18,6 +18,17 @@ Vue.use(VeeValidate); // forms validation for vuejs
|
||||
let router = new VueRouter({ linkActiveClass: "inpath", linkExactActiveClass: "active" });
|
||||
router.addRoutes(routes);
|
||||
|
||||
// manipulate the title page
|
||||
router.beforeEach((to, from, next) => {
|
||||
if (to.meta && to.meta.title) {
|
||||
window.document.title = to.meta.title;
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
import { store } from "./store";
|
||||
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
<footer>
|
||||
<div class="container">
|
||||
<button @click="openProgram('production')" class="oval main-production" :class="{ big:isInPath('production') && !state.isMainViewLiftedUp}"> </button>
|
||||
<button @click="openProgram('tools')" class="oval tools-manager" :class="{ big:isInPath('tools') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('report')" class="oval report-manager" :class="{ big:isInPath('report') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('alarms')" class="oval alarms-manager" :class="{ big:isInPath('alarms') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('maintenance')" class="oval maintenance-manager" :class="{ big:isInPath('maintenance') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('utilities')" class="oval utilities" :class="{ big:isInPath('utilities') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('/production')" class="oval main-production" :class="{ big:isInPath('production') && !state.isMainViewLiftedUp}"> </button>
|
||||
<button @click="openProgram('/tools')" class="oval tools-manager" :class="{ big:isInPath('tools') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('/report')" class="oval report-manager" :class="{ big:isInPath('report') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('/alarms')" class="oval alarms-manager" :class="{ big:isInPath('alarms') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('/maintenance')" class="oval maintenance-manager" :class="{ big:isInPath('maintenance') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('/utilities')" class="oval utilities" :class="{ big:isInPath('utilities') && !state.isMainViewLiftedUp}"></button>
|
||||
<button @click="openProgram('/test/header')" class="oval scada" :class="{ big:isInPath('/test/header') && !state.isMainViewLiftedUp}"></button>
|
||||
</div>
|
||||
<div class="machine-area">
|
||||
|
||||
Reference in New Issue
Block a user