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

chore(qiankun): microApp auto setLoading #293

Merged
merged 3 commits into from
Jul 8, 2020
Merged

Conversation

ycjcl868
Copy link
Contributor

@ycjcl868 ycjcl868 commented Jul 6, 2020

Close #233
ref: umijs/umi#4979 ,单独发不受 umi callback 影响

子应用默认情况下,会自动处理 loading

如果子应用需要精准控制 loading,通过

// app.ts
export const qiankun = {
   slave: {
      // 关闭自动 loading
      autoSetLanding: false
   }
}

在子应用页面中,单独调用 setLoading

// pages/Bar.tsx
import React from 'react';
import { useModel } from 'umi';

export default () => {
   const { setLoading } = useModel('@@qiankunStateFromMaster');
   React.useEffect(() => {
     setLoading(false);
   }, []);   
  ...
}

@ycjcl868 ycjcl868 requested a review from kuitos July 6, 2020 08:44
@ycjcl868 ycjcl868 added the enhancement New feature or request label Jul 6, 2020
@ycjcl868 ycjcl868 changed the title feat(qiankun): microApp auto setLoading chore(qiankun): microApp auto setLoading Jul 6, 2020
@codecov
Copy link

codecov bot commented Jul 7, 2020

Codecov Report

Merging #293 into master will decrease coverage by 0.12%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
- Coverage   44.14%   44.01%   -0.13%     
==========================================
  Files          73       73              
  Lines        1767     1772       +5     
  Branches      493      496       +3     
==========================================
  Hits          780      780              
- Misses        987      992       +5     
Impacted Files Coverage Δ
packages/plugin-qiankun/src/slave/lifecycles.ts 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1135b88...c41a9dc. Read the comment docs.

@kuitos kuitos merged commit 18c15f2 into master Jul 8, 2020
@delete-merged-branch delete-merged-branch bot deleted the feat-qiankun-loading branch July 8, 2020 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

umi-plugin-qiankun 透出加载完成事件
2 participants