@dabobo/utils
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

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/
);

Package Sidebar

Install

npm i @dabobo/utils

Weekly Downloads

9

Version

1.2.3

License

none

Unpacked Size

6.59 kB

Total Files

7

Last publish

Collaborators

  • woritd