use-app
TypeScript icon, indicating that this package has built-in type declarations

1.30.1 • Public • Published

SIMPLE-QK

qiankun提供便捷的组件注册和微应用路由注册

注册微应用

import { QKRegisterApp } from 'simple-qk';

// 注册微应用
const app = QKRegisterApp({
  routes: routesMicroApps,
  config: {
    mode: config.ROUTE_MODE,
    env: env ? 'prod' : 'dev', // 当前环境变量
    devParam: proxyJson().microApps
  },
  action: { // 生命周期
    beforeLoad: async (app: any) => {
      console.log('before load [CONTAINER]', app.name);
    },
    beforeMount: async (app: any) => {
      console.log('before mount [CONTAINER]', app.name);
    }
  }
});

app.start();

Default Component

  • 微应用默认 router-view 默认使用 vue@next 创建
  • 微应用注册 component 必填
import { QKRegisterMicroApp } from 'simple-qk';

// 注册微应用路由
QKRegisterMicroApp({
  option: {
    component: // custom component
    // ...
  }
  // ...
})

Dependencies (2)

Dev Dependencies (32)

Package Sidebar

Install

npm i use-app

Weekly Downloads

0

Version

1.30.1

License

MIT

Unpacked Size

744 kB

Total Files

19

Last publish

Collaborators

  • nam1010082085