首页 > 解决方案 > 单水疗 Angular 10 中的路由问题

问题描述

我正在使用带有 Angular 10 应用程序的单水疗中心。路由有问题,当我使用“activeWhen:[”/“]”加载应用程序时,它工作正常,但如果我添加路由,我会收到“404(未找到)”错误。这是我的配置,有什么问题吗?

<script>
    Promise.all([System.import('single-spa')]).then(([singleSpa]) => {
        const { registerApplication, start } = singleSpa;
        registerApplication({
            name: "uiservice11",
            app: () => System.import("uiservice11"),
            activeWhen: ["/"]
        });
        registerApplication({
            name: "uiservice1",
            app: () => System.import("uiservice1"),
            activeWhen: ["/home"]
        });
        start({
            urlRerouteOnly: true,
        });
    });
</script>

标签: angularwebpackwebpack-dev-serversingle-spasingle-spa-angular

解决方案


推荐阅读