Skip to content

Commit 87a8497

Browse files
committed
docs
1 parent 2b2b6b8 commit 87a8497

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

apps/example/src/pages/docs/getting-started.en-US.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,24 @@ Options:
520520
In addition to using `key` to set the button type, you can also freely configure the toolbar button object, or override the default built-in button component
521521

522522
```jsx
523-
import { DragStyledItem, DragStyledLabel } from 'react-image-previewer/ui'
523+
import { DragStyledItem, DragStyledLabel, DragDownload, DragScaleCount } from 'react-image-previewer/ui'
524524

525525
<DragToolbar {...props} items={
526526
[
527527
'arrowLeft', 'countText', 'arrowRight',
528528
'split',
529+
{
530+
key: 'download',
531+
component: props => {
532+
return <Tooltip><DragDownload {...props} /></Tooltip>
533+
}
534+
},
535+
{
536+
key: '',
537+
component: props => {
538+
return <DragScaleCount {...props} />{ 100 * props.scale }</DragScaleCount>
539+
}
540+
},
529541
{
530542
key: 'dog',
531543
component: ({ index }) => {

apps/example/src/pages/docs/getting-started.zh-CN.mdx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,24 @@ import { DragToolbar, CloseButton } from 'react-image-previewer/ui'
520520
除了使用 `key` 来设置按钮类型,还可以自由配置工具栏按钮对象,或者覆盖默认内置按钮组件
521521

522522
```jsx
523-
import { DragStyledItem, DragStyledLabel } from 'react-image-previewer/ui'
523+
import { DragStyledItem, DragStyledLabel, DragDownload, DragScaleCount } from 'react-image-previewer/ui'
524524

525525
<DragToolbar {...props} items={
526526
[
527527
'arrowLeft', 'countText', 'arrowRight',
528528
'split',
529+
{
530+
key: 'download',
531+
component: props => {
532+
return <Tooltip><DragDownload {...props} /></Tooltip>
533+
}
534+
},
535+
{
536+
key: '',
537+
component: props => {
538+
return <DragScaleCount {...props} />{ 100 * props.scale }</DragScaleCount>
539+
}
540+
},
529541
{
530542
key: 'dog',
531543
component: ({ index }) => {

0 commit comments

Comments
 (0)