如何http://localhost:3090/,默认跳转到http://localhost:3090/#/login

如何http://localhost:3090/,默认跳转到http://localhost:3090/#/login

path: '/',
redirect: {name: 'index'},
 
//跳转到登陆页面
next({name: 'login'});
改成next({name: 'logins'});
没有跳转,同时路由也没有变化是http://localhost:3090/#/

to:
{
    "fullPath": "/login",
    "path": "/login",
    "query": {},
    "hash": "",
    "name": "login",
    "params": {},
    "matched": [
        {
            "path": "/login",
            "name": "login",
            "meta": {
                "title": "登录"
            },
            "props": {
                "default": false
            },
            "children": [],
            "instances": {
                "default": {}
            },
            "leaveGuards": {},
            "updateGuards": {},
            "enterCallbacks": {},
            "components": {
                "default": {
                    "__name": "dir-login-info",
                    "__hmrId": "63341a53",
                    "__scopeId": "data-v-63341a53",
                    "__file": "D:/桌面/learn_vue3/vue3-antd-plus/admin-template/src/views/sys/login/dir-login-info.vue"
                }
            }
        }
    ],
    "meta": {
        "title": "登录"
    },
    "href": "#/login"
}

from:
{
    "path": "/",
    "params": {},
    "query": {},
    "hash": "",
    "fullPath": "/",
    "matched": [],
    "meta": {}
}

 

posted @ 2024-06-02 01:42  爱晒太阳的懒猫。。  阅读(39)  评论(0编辑  收藏  举报