generated from arvinxx/monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
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
6 changed files
with
94 additions
and
16 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
docs/components/common/examples/PageLoading/Fullscreen.tsx
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,28 @@ | ||
import React, { useState } from 'react'; | ||
import { Button, Card } from 'antd'; | ||
|
||
import PageLoading from '@arvinxu/page-loading'; | ||
|
||
const FullScreenLoading = () => { | ||
const [fullscreen, setFullScreen] = useState(false); | ||
|
||
return ( | ||
<div> | ||
{fullscreen ? ( | ||
<Button style={{ zIndex: 100000 }} onClick={() => setFullScreen(false)}> | ||
取消全屏 | ||
</Button> | ||
) : ( | ||
<Button onClick={() => setFullScreen(true)}>全屏</Button> | ||
)} | ||
|
||
<div style={{ height: 300, marginTop: 16 }}> | ||
<PageLoading fullscreen={fullscreen} id={'fullscreen'}> | ||
<Card>内容卡片</Card> | ||
</PageLoading> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default FullScreenLoading; |
28 changes: 28 additions & 0 deletions
28
docs/components/common/examples/PageLoading/LoadingState.tsx
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,28 @@ | ||
import React, { useState } from 'react'; | ||
import { Button, Card } from 'antd'; | ||
|
||
import PageLoading from '@arvinxu/page-loading'; | ||
|
||
const { Group } = Button; | ||
const Loading = () => { | ||
const [loading, setLoading] = useState(false); | ||
|
||
return ( | ||
<div> | ||
<Group> | ||
<Button onClick={() => setLoading(true)}>加载中</Button> | ||
<Button onClick={() => setLoading(false)}>加载完成</Button> | ||
</Group> | ||
<span style={{ marginLeft: 8 }}> | ||
状态: {loading ? '加载中' : '加载完成'} | ||
</span> | ||
<div style={{ height: 300, marginTop: 16 }}> | ||
<PageLoading loading={loading} id={'loading'}> | ||
<Card>内容卡片</Card> | ||
</PageLoading> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Loading; |
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
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