@dabobo/utils
v1.2.3
Published
dabobo utils
Downloads
9
Maintainers
Readme
Install
yarn add @dabobo/utils
或者 npm i @dabobo/utils
Useage
/**
declare module 'utils' {
export function createRouterMap(context: typeof require.context, exclude?: RegExp) : routerMap;
type routerMap = {
routes: Array<router>;
map: {
path: string;
uri: string;
component: object;
}
}
type router = {
path: string;
uri: string;
component: any;
children: Array<router>
}
}
**/
import { createRouterMap } from '@dabobo/utils';
const { routes } = createRouterMap(
require.context('./src/views', true, /\.vue/, 'lazy'),
/\/404\.vue/
);