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

types(keepalive): 修复customTabs时会丢失TabConfig类型的问题 #658

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tangbzai
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Jun 21, 2024

⚠️ No Changeset found

Latest commit: ceb561d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Jun 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
alita-alita ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 6:56am

@xiaohuoni
Copy link
Member

忙改我不敢合,请详细说明发生什么错误,然后给个复现

@tangbzai
Copy link
Contributor Author

修改说明

  1. 对外暴露 KeepAliveContextProps 类型,让使用者可以通过 import type { KeepAliveContextProps } from 'umi' 导入
  2. 修复了hasCustomTabs: true 时,没有导入 TabConfig 导致 KeepAliveContextPropsupdateTab 方法的第二个参数类型丢失的问题(23行和36行调整到25行到29行)
  3. 因为 TabConfig 继承了 TabPaneProps 所以也需要把 TabPaneProps 放出来 (4-10行,原本这部分是“非自定义tab且开启tab布局时才导入的Tab相关类型”改为“只要开启tab布局就导入 TabPaneProps 如果是非自定义tab 则导入其余所需类型 ”)

复现
配置 tabsLayouthasCustomTabs 即可在 src/.umi/plugin-keepalive/context.tsx 中观察到
复现小demo

@xiaohuoni
Copy link
Member

@chj-damon 杰哥,来兜底

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

Successfully merging this pull request may close these issues.

2 participants