generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* title: 默认的 antd 组件 | ||
* description: 默认情况下, Demo 与文档站的主题互相隔离 | ||
* compact: true | ||
*/ | ||
import { Alert, Button, theme } from 'antd'; | ||
import { Flexbox } from 'react-layout-kit'; | ||
|
||
export default () => { | ||
const { token } = theme.useToken(); | ||
return ( | ||
<Flexbox gap={8} padding={24} style={{ background: token.colorBgLayout }}> | ||
<Flexbox horizontal gap={8}> | ||
<Button type={'primary'}>按钮</Button> | ||
<Button>按钮</Button> | ||
</Flexbox> | ||
|
||
<Alert showIcon banner type={'success'} message={'成功的通知'}></Alert> | ||
<Alert showIcon banner type={'error'} message={'失败信息'}></Alert> | ||
</Flexbox> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* title: 继承站点主题的 antd 组件 | ||
* description: "添加 `inherit: true`,可以让 Demo 继承文档站主题" | ||
* compact: true | ||
* inherit: true | ||
*/ | ||
|
||
import Antd from './Antd'; | ||
|
||
export default Antd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: Demo 研发 | ||
order: 6 | ||
group: 特性 | ||
demo: | ||
cols: 2 | ||
--- | ||
|
||
## Demo 研发 | ||
|
||
该主题默认会保证 antd 的默认主题样式,如果需要 demo 集成文档站的主题,可以通过对文档配置 `inherit: true` 属性来指定。 | ||
|
||
<code src="../demos/Antd.tsx"></code> | ||
<code src="../demos/AntdInherit.tsx"></code> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ConfigProvider } from 'antd'; | ||
import type { FC, PropsWithChildren } from 'react'; | ||
|
||
interface DemoProviderProps extends PropsWithChildren { | ||
inherit?: boolean; | ||
} | ||
const DemoProvider: FC<DemoProviderProps> = ({ children, inherit = false }) => { | ||
return ( | ||
<ConfigProvider prefixCls={inherit ? 'ant' : undefined} theme={{ inherit }}> | ||
{children} | ||
</ConfigProvider> | ||
); | ||
}; | ||
|
||
export default DemoProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { useOutlet } from 'dumi'; | ||
import DemoProvider from '../../components/DemoProvider'; | ||
|
||
export default () => { | ||
const outlet = useOutlet(); | ||
|
||
return <DemoProvider>{outlet}</DemoProvider>; | ||
}; |
02d36a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
dumi-theme-antd-style – ./
dumi-theme-antd-style-arvinxx.vercel.app
dumi-theme-antd-style-git-master-arvinxx.vercel.app
dumi-theme-antd-style.vercel.app
dumi-theme-antd-style.arvinx.app