Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

主应用是ant-design-pro 4.0.0,如何按照qiankun的方式注册子应用呢? #2915

Open
kgloveyou opened this issue Feb 28, 2024 · 4 comments

Comments

@kgloveyou
Copy link

kgloveyou commented Feb 28, 2024

在qiankun的快速上手部分(https://qiankun.umijs.org/zh/guide/getting-started#%E4%B8%BB%E5%BA%94%E7%94%A8),
2. 在主应用中注册微应用

import { registerMicroApps, start } from 'qiankun';

registerMicroApps([
  {
    name: 'react app', // app name registered
    entry: '//localhost:7100',
    container: '#yourContainer',
    activeRule: '/yourActiveRule',
  },
  {
    name: 'vue app',
    entry: { scripts: ['//localhost:7100/main.js'] },
    container: '#yourContainer2',
    activeRule: '/yourActiveRule2',
  },
]);

start();

这些应该在程序的入口文件中写,但是ant-design-pro 4.0.0没有找到类似的入口文件,应该写在哪里呢?

在线仓库,https://github.com/kgloveyou/my-antd-app-complete

Copy link

由于缺乏足够的信息(github、stackblitz、codesandbox等可复现仓库),我们暂时关闭了该 Issue。请修改(不要回复) Issue 提供最小重现以重新开启。谢谢。如果只是单独的技术咨询,可移步 https://qiankun.umijs.org/#-community 交流~

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2024
@github-actions github-actions bot reopened this Feb 28, 2024
@gongshun
Copy link
Collaborator

ant-design-pro 用的是 umi,用 umi 的 plugin-qiankun 就行了

文档:https://v3.umijs.org/plugins/plugin-qiankun

参考demo:https://github.com/gongshun/qiankun-ant-design-pro-demo

@kgloveyou
Copy link
Author

ant-design-pro 用的是 umi,用 umi 的 plugin-qiankun 就行了

文档:https://v3.umijs.org/plugins/plugin-qiankun

参考demo:https://github.com/gongshun/qiankun-ant-design-pro-demo

我的子应用是cra项目,主应用还能用umi qiankun的方式写吗?

@qiYuei
Copy link
Contributor

qiYuei commented Mar 4, 2024

可用 loadMicroApp 的方式手动加载微应用
文档: https://qiankun.umijs.org/zh/api#loadmicroappapp-configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants