Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Instantiate router
- var router = new VueRouter({
- history: true,
- saveScrollPosition: true
- });
- var itemFactory = require('./components/itemFactory.vue');
- console.log(itemFactory);
- // Routes
- router.map({
- '/': {
- name: 'dashboard',
- component: require('./components/dashboard.vue')
- },
- '/upgrade': {
- name: 'upgrade',
- component: require('./components/upgrade.vue')
- },
- '/account': {
- name: 'account',
- component: require('./components/account.vue')
- },
- '/billing': {
- name: 'billing',
- component: require('./components/billing.vue')
- },
- '/users': {
- name: 'users',
- component: require('./components/users.vue')
- },
- '/items/edit/:itemID': {
- name: 'editItems',
- component: Vue.extend({
- components: {itemFactory},
- template: "<itemFactory mode='edit'></itemFactory>"
- })
- },
- '/items/create': {
- name: 'createItems',
- component: Vue.extend({
- components: {itemFactory},
- template: "<itemFactory mode='create'></itemFactory>"
- })
- },
- '/items/details/:checkID': {
- name: 'itemDetails',
- component: require('./components/itemDetails.vue')
- }
- });
- // Start!
- router.start(app, '#wrapper');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement