From 0afd9a90bdbaa75ebea64aae1d8548b5635e5456 Mon Sep 17 00:00:00 2001 From: tangbzai <47456577+tangbzai@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:46:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?types(keepalive):=20=E4=BF=AE=E5=A4=8Dcusto?= =?UTF-8?q?mTabs=E6=97=B6=E4=BC=9A=E4=B8=A2=E5=A4=B1TabConfig=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/plugins/templates/keepalive/context.tpl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/plugins/templates/keepalive/context.tpl b/packages/plugins/templates/keepalive/context.tpl index 7b0cf8e5..00ea35dd 100644 --- a/packages/plugins/templates/keepalive/context.tpl +++ b/packages/plugins/templates/keepalive/context.tpl @@ -1,12 +1,13 @@ // tpl 语法非常乱,修改这个文件,请仔细仔细再仔细的验证之后再提交代码 import React, { ReactNode, useEffect } from 'react'; import { useOutlet, useLocation, matchPath, useNavigate } from 'react-router-dom' -{{^hasCustomTabs}} {{#hasTabsLayout}} -import { Tabs, message, Dropdown, Button, Menu, TabPaneProps } from "antd"; +import type { TabPaneProps } from "antd"; +{{^hasCustomTabs}} +import { Tabs, message, Dropdown, Button, Menu } from "antd"; import { EllipsisOutlined, VerticalRightOutlined, VerticalLeftOutlined, CloseOutlined, ReloadOutlined } from "@ant-design/icons"; -{{/hasTabsLayout}} {{/hasCustomTabs}} +{{/hasTabsLayout}} {{#hasTabsLayout}} import { getPluginManager } from '../core/plugin'; {{/hasTabsLayout}} @@ -20,11 +21,12 @@ import { useAppData } from '../exports'; {{#hasIntl}} import { useIntl } from '../exports'; {{/hasIntl}} -{{^hasCustomTabs}} {{#hasTabsLayout}} +{{^hasCustomTabs}} {{^isNewTabsAPISupported}} const { TabPane } = Tabs; {{/isNewTabsAPISupported}} +{{/hasCustomTabs}} export interface TabConfig extends TabPaneProps{ icon?: ReactNode; @@ -33,7 +35,6 @@ export interface TabConfig extends TabPaneProps{ } {{/hasTabsLayout}} -{{/hasCustomTabs}} export interface KeepAliveContextProps { From ceb561d5cddd00f8b880aa373c0b17d1c224b3f2 Mon Sep 17 00:00:00 2001 From: tangbzai <47456577+tangbzai@users.noreply.github.com> Date: Fri, 21 Jun 2024 14:55:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?types(keepalive):=20=E8=AE=A9KeepAliveConte?= =?UTF-8?q?xtProps=E7=B1=BB=E5=9E=8B=E5=8F=AF=E4=BB=A5=E9=80=9A=E8=BF=87um?= =?UTF-8?q?i=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/plugins/src/keepalive.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugins/src/keepalive.ts b/packages/plugins/src/keepalive.ts index cfc005b7..7f3a3870 100644 --- a/packages/plugins/src/keepalive.ts +++ b/packages/plugins/src/keepalive.ts @@ -104,7 +104,7 @@ export function closeAllTabs() { noPluginDir: true, path: `${DIR_NAME}/index.tsx`, content: ` -export { KeepAliveContext,useKeepOutlets } from './context'; +export { KeepAliveContext, type KeepAliveContextProps, useKeepOutlets } from './context'; export { dropByCacheKey, closeTab, closeAllTabs } from './support'; `, });