forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request alibaba-fusion#3983 from alibaba-fusion/feat/1.26
Feat/1.26
- Loading branch information
Showing
57 changed files
with
1,551 additions
and
171 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# 快捷调用 | ||
|
||
- order: 6 | ||
|
||
快捷调用 | ||
|
||
:::lang=en-us | ||
# Quick | ||
|
||
- order: 0 | ||
|
||
First drawer | ||
::: | ||
--- | ||
|
||
````jsx | ||
import { Button, Drawer } from '@alifd/next'; | ||
|
||
let instance = null; | ||
const show = () => { | ||
instance = Drawer.show({ | ||
title: 'quick', | ||
hasMask: false, | ||
content: <span>hello world</span> | ||
}) | ||
} | ||
const hide = () => { | ||
instance && instance.hide(); | ||
instance = null; | ||
} | ||
|
||
ReactDOM.render(<div> | ||
<Button type="primary" onClick={show}> open </Button> | ||
<Button onClick={hide} style={{marginLeft: 8}}> close </Button> | ||
</div>, mountNode); | ||
```` |
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,56 @@ | ||
# 宽高 | ||
|
||
- order: 5 | ||
|
||
可以通过 width 设置容器宽度,或者设置 width=auto 自适应内容宽度 | ||
|
||
:::lang=en-us | ||
# Size | ||
|
||
- order: 0 | ||
|
||
First drawer | ||
::: | ||
--- | ||
|
||
````jsx | ||
import { useState } from 'react'; | ||
import { Button, Drawer } from '@alifd/next'; | ||
|
||
const Demo = () => { | ||
const [visible, setVisible] = useState(false); | ||
const [visible2, setVisible2] = useState(false); | ||
const [width, setWidth] = useState(200); | ||
|
||
return ( | ||
<div> | ||
<Button type="primary" onClick={setVisible}> fixed 700 </Button> | ||
<Drawer | ||
v2 | ||
width={700} | ||
title="set width to 700" | ||
placement="right" | ||
visible={visible} | ||
onClose={() => setVisible(false)}> | ||
Start your business here by searching a popular product | ||
</Drawer> | ||
<Button type="primary" onClick={setVisible2} style={{marginLeft: 8}}> auto width</Button> | ||
<Drawer | ||
v2 | ||
width="auto" | ||
title="auto width" | ||
placement="right" | ||
visible={visible2} | ||
onClose={() => setVisible2(false)}> | ||
<div style={{width: width}}> | ||
Start your business here by searching a popular product | ||
<br/><br/> | ||
<Button type="primary" onClick={() => setWidth(width + 100)}>larger width</Button> | ||
</div> | ||
</Drawer> | ||
</div> | ||
); | ||
} | ||
|
||
ReactDOM.render(<Demo />, mountNode); | ||
```` |
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
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
Oops, something went wrong.