代碼如下,我想對路由進行懶加載,但是能夠進行正在加載中的提示,按照官網提示,但是delay沒有效果路由加載:{ path: '/Me', name: 'Me', //component: r => import("@/views/loading/loadable")
component: asyncComponent()
}asyncComponent函數:import LoadingComponent from '@/views/loading/index.vue'import errorCom from '@/views/loading/error'export default (asyncComponent) => {const Com= function(){ let a = { component: require('@/views/Me'), loading: LoadingComponent, error: errorCom, delay: 2000
} return a
}return { render: function (h) { return h(Com, {})
}
}}
vue asyncComponent 異步加載路由參數delay等無效?
阿波羅的戰(zhàn)車
2018-08-03 19:00:39