I am trying to do the following:
(我正在尝试执行以下操作:)
import Vue from "vue";
import Router from "vue-router";
import Home from "./views/Home.vue";
import LoadingComponent from '@/components/Loading.vue';
Vue.use(Router);
const router = new Router({
routes: [
{
path: "/",
name: "home",
component: Home
},
{
path: "/about",
name: "about",
component: () => ({
component: import("./views/About.vue"),
loading: LoadingComponent,
delay: 1
})
}
]
});
export default router;
However loading component is never showing, even when I set network to Slow 3G
.
(但是,即使将网络设置为Slow 3G
,加载组件也永远不会显示。)
This happens only when I use async components in router, everywhere else loading components shows after delay.(仅当我在路由器中使用异步组件时,才会发生这种情况,其他所有加载组件都会在延迟之后显示。)
Is this not supported by Vue Router or am I doing something wrong?
(Vue路由器不支持此功能吗,或者我做错了什么?)
ask by Filip Egeric translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…