export default {
path: '/about',
name: 'About',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: (): Promise<any> => import(/* webpackChunkName: "about" */ '../../views/About.vue'),
};
I am using Vue3 & vue-router & eslint air-bnb,
the eslint check says i need to set the right type, how do i check the type and what type should fill to avoid the eslint check? many thanks
The correct return type is Promise<RouteComponent>
import { RouteComponent } from "vue-router";
export default {
path: '/about',
name: 'About',
component: (): Promise<RouteComponent> => import('../../views/About.vue'),
};
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.