码迷,mamicode.com
首页 > 其他好文 > 详细

vue-router

时间:2017-06-10 17:00:39      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:efault   router   man   class   bsp   --   export   nts   关键字   

/**
 *
 *  路由参考例子说明
 * ‘/flowhistory‘:{     -----------url跳转后显示的内容
    name:‘flowhistory‘,     -----------路由跳转关键字,这里作强制要求,必须与url跳转内容一致
        component: function(resolve){
        require([‘./views/glocalme-flowhistory.vue‘],resolve);      -----------模块所在位置
    },
    auth: true      -----------模块是否需要路由验证
},
 *
 *
 */
‘use strict‘;

export default function(router) {
    router.map({
       
        ‘/‘: {
            name: ‘index‘,
            component: function (resolve) {
                require([‘./views/index.vue‘], resolve);
            }
        },

        ‘*‘: {
            name: ‘404‘,
            component: function (resolve) {
                require([‘./views/404.vue‘], resolve);
            }
        },

        ‘/components‘: {
            name: ‘components‘,
            component: function (resolve) {
                require([‘./views/components.vue‘], resolve);
            }
        },
‘/login‘: { name: ‘login‘, component: function (resolve) { require([‘./views/login.vue‘], resolve); } }, /** * 主页 * 时间:2016-11-17 * 负责人:chenwenxiao * */ ‘/home‘: { name: ‘home‘, component: function (resolve) { require([‘./views/index.vue‘], resolve); }, auth: true, subRoutes: { ‘/homePage‘: { name: ‘homePage‘, component: function (resolve) { require([‘./views/page/home.vue‘], resolve); }, auth: true }, ‘/rdtest‘: { name: ‘rdtest‘, component: function (resolve) { require([‘./views/page/systemManager/rdtest.vue‘], resolve); }, auth: true } } } }

 

vue-router

标签:efault   router   man   class   bsp   --   export   nts   关键字   

原文地址:http://www.cnblogs.com/yanyiyi/p/6978776.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!