12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import Home from 'vuejs/components/Pages/Home'
- import Base from 'vuejs/components/Pages/Base'
- import Blabla from 'vuejs/components/Pages/Blabla'
- import Article from 'vuejs/components/Pages/Article'
- import Showrooms from 'vuejs/components/Pages/Showrooms'
- import Pricing from 'vuejs/components/Pages/Pricing'
- // import Cart from 'vuejs/components/Pages/Cart'
- Vue.use(VueRouter)
- // https://www.lullabot.com/articles/decoupled-hard-problems-routing
- // We could use aliases to never reload the page on language changement
- // BUT beforeupdate is not triggered when push alias instead of path or name
- // const languages = ['en', 'fr'];
- // console.log('path aliases', (() => languages.map(l => `/${l}/base`))() );
- let basePath = drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix;
- const routes = [
- {
- name: 'home',
- path: basePath,
- // path: '/',
- // alias: (() => languages.map(l => `/${l}`))(),
- component: Home
- // components: {
- // 'home': Home
- // }
- },
- {
- name:'base',
- path: `${basePath}base`,
- // path: `/base`,
- // alias: (() => languages.map(l => `/${l}/base`))(),
- component: Base,
- // components: {
- // 'base': Base
- // }
- },
- // {
- // name:'blabla',
- // path: `${basePath}blabla`,
- // component: Blabla,
- // children: [
- // {
- // path: `${basePath}blabla/:alias`,
- // component: Article
- // }
- // ]
- // }
- {
- name:'blabla',
- path: `${basePath}blabla`,
- component: Blabla
- },
- {
- name:'article',
- path: `${basePath}blabla/:alias`,
- component: Article,
- // meta: { uuid:null }
- },
- {
- name:'showrooms',
- path: `${basePath}showrooms`,
- component: Showrooms,
- // meta: { uuid:null }
- },
- // {
- // path: '*',
- // name: 'notfound',
- // components: {
- // 'notfound': NotFound
- // }
- // },
- {
- name:'pricing',
- path: `${basePath}pricing`,
- component: Pricing
- }
- // {
- // name:'cart',
- // path: `${basePath}cart`,
- // component: Cart
- // }
- ]
- export default new VueRouter({
- mode: 'history',
- routes: routes
- })
|