-
Notifications
You must be signed in to change notification settings - Fork 26
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 #59 from ant-design/feat/tips
feat: add more ActionGroupApi support
- Loading branch information
Showing
9 changed files
with
1,565 additions
and
765 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { CopyOutlined, DragOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons'; | ||
import { ActionGroup } from '@ant-design/pro-editor'; | ||
import { message } from 'antd'; | ||
|
||
export default () => { | ||
const [messageApi, contextHolder] = message.useMessage(); | ||
|
||
return ( | ||
<> | ||
{contextHolder} | ||
<ActionGroup | ||
dropdownMenu={[ | ||
{ | ||
icon: <CopyOutlined />, | ||
onClick: () => { | ||
messageApi.info('复制!'); | ||
}, | ||
label: '复制', | ||
}, | ||
{ | ||
icon: <ZoomInOutlined />, | ||
onClick: () => { | ||
messageApi.success('放大!'); | ||
}, | ||
label: '放大!', | ||
}, | ||
{ | ||
icon: <ZoomOutOutlined />, | ||
style: { | ||
color: '#1890ff', | ||
}, | ||
onClick: () => { | ||
messageApi.success('缩小!'); | ||
}, | ||
label: '缩小!', | ||
}, | ||
{ | ||
type: 'divider', | ||
}, | ||
{ | ||
icon: <DragOutlined />, | ||
onClick: () => { | ||
messageApi.loading('快速定位ing'); | ||
}, | ||
label: '快速定位', | ||
}, | ||
]} | ||
/> | ||
</> | ||
); | ||
}; |
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,30 @@ | ||
import { ActionGroup } from '@ant-design/pro-editor'; | ||
import { InputNumber, Segmented, Space } from 'antd'; | ||
import { useState } from 'react'; | ||
|
||
export default () => { | ||
const [type, setType] = useState<string | any>('block'); | ||
const [size, setSize] = useState<string | number | any>('default'); | ||
const [direction, setDirection] = useState<'row' | 'column' | any>('row'); | ||
const [number, setNumber] = useState<number>(24); | ||
|
||
return ( | ||
<Space direction="vertical"> | ||
<Segmented options={['pure', 'ghost', 'block']} value={type} onChange={setType} /> | ||
<Segmented options={['default', 'large', 'number']} value={size} onChange={setSize} /> | ||
{size === 'number' && ( | ||
<InputNumber | ||
min={18} | ||
max={200} | ||
defaultValue={24} | ||
onChange={(value) => { | ||
setNumber(value); | ||
}} | ||
/> | ||
)} | ||
|
||
<Segmented options={['row', 'column']} value={direction} onChange={setDirection} /> | ||
<ActionGroup type={type} size={size === 'number' ? number : size} direction={direction} /> | ||
</Space> | ||
); | ||
}; |
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.