feat(SubTabContainer): 支持 Tab 激活状态和刷新机制
- SubTabContainer: 新增 isActive 和 activationKey props 传递给子组件 - SubTabContainer: 修复 Tab 切换时页面滚动位置跳转问题 - TabPanelContainer: 新增 skeleton prop 支持自定义骨架屏 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,8 @@ export interface TabPanelContainerProps {
|
||||
loadingMessage?: string;
|
||||
/** 加载状态高度 */
|
||||
loadingHeight?: string;
|
||||
/** 自定义骨架屏组件,优先于默认 Spinner */
|
||||
skeleton?: React.ReactNode;
|
||||
/** 子组件间距,默认 6 */
|
||||
spacing?: number;
|
||||
/** 内边距,默认 4 */
|
||||
@@ -74,6 +76,7 @@ const TabPanelContainer: React.FC<TabPanelContainerProps> = memo(
|
||||
loading = false,
|
||||
loadingMessage = '加载中...',
|
||||
loadingHeight = '200px',
|
||||
skeleton,
|
||||
spacing = 6,
|
||||
padding = 4,
|
||||
showDisclaimer = false,
|
||||
@@ -81,6 +84,10 @@ const TabPanelContainer: React.FC<TabPanelContainerProps> = memo(
|
||||
children,
|
||||
}) => {
|
||||
if (loading) {
|
||||
// 如果提供了自定义骨架屏,使用骨架屏;否则使用默认 Spinner
|
||||
if (skeleton) {
|
||||
return <>{skeleton}</>;
|
||||
}
|
||||
return <LoadingState message={loadingMessage} height={loadingHeight} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user