-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 manually specify routes for lazy loading
- Loading branch information
Showing
6 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import Vue from 'vue'; | ||
import Router from 'vue-router'; | ||
|
||
const Index = () => | ||
import(/* webpackChunkName: "group-index" */ '@/pages/index.vue').then(m => m.default || m); | ||
const Login = () => | ||
import(/* webpackChunkName: "group-login" */ '@/pages/login.vue').then(m => m.default || m); | ||
const Register = () => | ||
import(/* webpackChunkName: "group-register" */ '@/pages/register.vue').then(m => m.default || m); | ||
const Results = () => | ||
import(/* webpackChunkName: "group-results" */ '@/pages/results.vue').then(m => m.default || m); | ||
const Watch = () => | ||
import(/* webpackChunkName: "group-watch" */ '@/pages/watch.vue').then(m => m.default || m); | ||
|
||
const Channel = () => | ||
import(/* webpackChunkName: "group-channel" */ '@/pages/channel.vue').then(m => m.default || m); | ||
const Embed = () => | ||
import(/* webpackChunkName: "group-embed" */ '@/pages/embed.vue').then(m => m.default || m); | ||
const SubscriptionIndex = () => | ||
import(/* webpackChunkName: "group-subscription" */ '@/pages/subscriptions/index.vue').then( | ||
m => m.default || m | ||
); | ||
const SubscriptionManage = () => | ||
import(/* webpackChunkName: "group-subscription" */ '@/pages/subscriptions/manage.vue').then( | ||
m => m.default || m | ||
); | ||
|
||
Vue.use(Router); | ||
|
||
export function createRouter() { | ||
return new Router({ | ||
mode: 'history', | ||
routes: [ | ||
{ | ||
path: '/', | ||
component: Index | ||
}, | ||
{ | ||
path: '/login', | ||
component: Login | ||
}, | ||
{ | ||
path: '/register', | ||
component: Register | ||
}, | ||
{ | ||
path: '/results', | ||
component: Results | ||
}, | ||
{ | ||
path: '/watch', | ||
component: Watch | ||
}, | ||
{ | ||
path: '/embed/:id', | ||
component: Embed | ||
}, | ||
{ | ||
path: '/channel/:id', | ||
component: Channel | ||
}, | ||
{ | ||
path: '/subscriptions', | ||
component: SubscriptionIndex | ||
}, | ||
{ | ||
path: '/subscriptions/manage', | ||
component: SubscriptionManage | ||
} | ||
] | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters