账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    vue-cli3 开发多页面中的子页面中的路由为什么不能正常的访问
    37
    0
    1. 使用vue-cli3开发的多页面项目,pages的配置如下:
    pages: {
            index: {
                entry: './resources/src/main.js',
                template: './resources/public/index.html',
                filename: 'index.html'
            },
            print: {
                entry: './resources/src/print/main.js',
                template: './resources/public/print.html',
                filename: 'print.html'
            }
        }

    index中的路由配置:

    [
        {
            path: `${prefix}/createAccount`,
            name: 'createAccount',
            component: createAccount
        }]
    

    现在是访问index中的路由可以通过使用localhost:8080/foreground/createAccount是可以正常访问的
    print中的路由如下:

    [
        {
            path: `${prefix}/print`,
            name: 'print',
            component: index,
            beforeEnter: (to, from, next) => {
                console.log('wer')
                next()
            }
        }
    ]

    但是通过访问localhost:8080/print.html可以访问页面的,但是不能使用localhost:8080/print/foreground_print/print不能访问到print路由### 问题描述

    问题出现的环境背景及自己尝试过哪些方法

    GitHub代码

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部