Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/components/mdx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ const components = {
a: CustomLink,
Tabs,
TabItem,
// 代码演示组件
Demo: ({ children }: { children: React.ReactNode }) => (
<div className="my-6 rounded-lg border bg-card p-6">
<div className="mb-4 text-sm font-medium text-muted-foreground">演示</div>
{children}
</div>
),
}

export function CustomMDX(props) {
Expand Down
8 changes: 8 additions & 0 deletions content/changelog/demo-component.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 新增 Demo 组件

<Demo>
<div className="text-center p-6 bg-gradient-to-r from-blue-50 to-indigo-50 dark:from-blue-950 dark:to-indigo-950 rounded-lg">
<h3 className="text-xl font-semibold mb-2">使用 Demo 组件</h3>
<p className="text-muted-foreground mb-4">创建更加生动和交互式的内容</p>
</div>
</Demo>
Loading