(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{153:function(e,n,t){"use strict";t.r(n);var a=t(0),o=Object(a.a)({},function(){this.$createElement;this._self._c;return this._m(0)},[function(){var e=this,n=e.$createElement,t=e._self._c||n;return t("div",{staticClass:"content"},[t("h1",{attrs:{id:"routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#routing","aria-hidden":"true"}},[e._v("#")]),e._v(" Routing")]),e._v(" "),t("p",[e._v("New ibs member portal uses vue-router for routing purposes. We use the vue-router in history mode to remove the "),t("code",[e._v("#")]),e._v("\nfrom the url link. So our development environment has url rewrite configured.")]),e._v(" "),t("p",[e._v("The routing root file is in "),t("code",[e._v("src -> routing")]),e._v(". Where we do the default config. The router will pick up all the files ending with\n"),t("code",[e._v("router.js")]),e._v(" and merge all the routes to gather before starting up.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v(".\n├─ src\n│  ├─ routes\n│  │   └─ index.js // <------------------------------------- Main entry point for routes\n│  ├─ app\n│  │   ├─ xxx\n│  │   │   └─ _routes.js // <-------------------------------- Lookedup\n│  │   ├─ xxx\n│  │   │   └─ xxx\n│  │   │       └─ _routes.js // <---------------------------- Lookedup\n│  │   └─ xxx\n│  │       └─ xxx\n│  │           └─ xxx\n│  │               └─ _routes.js // <------------------------ Lookedup\n└─ xxx\n")])])]),t("h2",{attrs:{id:"creating-new-routes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#creating-new-routes","aria-hidden":"true"}},[e._v("#")]),e._v(" Creating New Routes")]),e._v(" "),t("p",[e._v("To create new routes, you have to create a routes.js file in the module. Following is an example")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("import { DASHBOARD_HOME as URL_PREFIX } from '@/config/url-prefix'\n\nexport default [\n  {\n    path: '/',\n    component: () => import('@/elements/templates/screens/SidebarFluid'),\n    name: 'Dashboard',\n    redirect: URL_PREFIX,\n    children: [\n      {\n        path: URL_PREFIX,\n        component: () => import('./components/Home'),\n        name: 'DashboardHome',\n        meta: {\n          title: '',\n          dashboardMenu: {\n            displayName: 'Eshop.Menu.Dashboard.Home',\n            priority: 11,\n            icon: 'sidebar-dashboard'\n          },\n          topMenu: {\n            displayName: 'Eshop.Menu.Dashboard.HomeWithBack',\n            priority: 0,\n            position: 'left'\n          }\n        }\n      }\n    ]\n  }\n]\n")])])]),t("h2",{attrs:{id:"adding-routes-to-menus"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#adding-routes-to-menus","aria-hidden":"true"}},[e._v("#")]),e._v(" Adding routes to menus")]),e._v(" "),t("p",[e._v("The menu system is configured to be generated using routes meta. You can see the menus generated in the system from\n"),t("code",[e._v("src -> config -> menu.js")]),e._v(". So you can specify the route to be added to any of the specified menu. Also the displayName\nused for the menu is passed through the translator so translated names can be used.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("import { DASHBOARD_HOME as URL_PREFIX } from '@/config/url-prefix'\n\nexport default [\n  {\n    path: '/',\n    component: () => import('@/elements/templates/screens/SidebarFluid'),\n    name: 'Dashboard',\n    redirect: URL_PREFIX,\n    children: [\n      {\n        path: URL_PREFIX,\n        component: () => import('./components/Home'),\n        name: 'DashboardHome',\n        meta: {\n          title: '',\n          dashboardMenu: {                            // <--│ \n            displayName: 'Eshop.Menu.Dashboard.Home', // <--│ This route will be added to dashboard \n            priority: 11,                             // <--│ menu.\n            icon: 'sidebar-dashboard'                 // <--│\n          },\n          topMenu: {\n            displayName: 'Eshop.Menu.Dashboard.HomeWithBack', // <--│ This route will be added to topMenu\n            priority: 0,                                      // <--│ menu.\n            position: 'left'                                  // <--│ \n          }\n        }\n      }\n    ]\n  }\n]\n")])])])])}],!1,null,null,null);n.default=o.exports}}]);