|
@@ -14,6 +14,7 @@ import {
|
|
IPhotoConsumerForwardProps,
|
|
IPhotoConsumerForwardProps,
|
|
IPhotoSliderForwardProps,
|
|
IPhotoSliderForwardProps,
|
|
} from '../';
|
|
} from '../';
|
|
|
|
+import defaultPhoto from '../default-photo.svg';
|
|
|
|
|
|
<Meta title="React-photo-view" />
|
|
<Meta title="React-photo-view" />
|
|
|
|
|
|
@@ -33,22 +34,6 @@ import {
|
|
</Story>
|
|
</Story>
|
|
</Preview>
|
|
</Preview>
|
|
|
|
|
|
-## 两张预览
|
|
|
|
-
|
|
|
|
-<Preview>
|
|
|
|
- <Story name="两张预览">
|
|
|
|
- <PhotoProvider>
|
|
|
|
- <ImageList>
|
|
|
|
- {photoImages.map((item, index) => (
|
|
|
|
- <PhotoConsumer key={index} src={item}>
|
|
|
|
- {index < 2 ? <ViewBox viewImage={item} /> : undefined}
|
|
|
|
- </PhotoConsumer>
|
|
|
|
- ))}
|
|
|
|
- </ImageList>
|
|
|
|
- </PhotoProvider>
|
|
|
|
- </Story>
|
|
|
|
-</Preview>
|
|
|
|
-
|
|
|
|
## 通过按钮触发
|
|
## 通过按钮触发
|
|
|
|
|
|
<Preview>
|
|
<Preview>
|
|
@@ -73,7 +58,7 @@ import {
|
|
<Button>无默认图</Button>
|
|
<Button>无默认图</Button>
|
|
</PhotoConsumer>
|
|
</PhotoConsumer>
|
|
</PhotoProvider>
|
|
</PhotoProvider>
|
|
- <PhotoProvider brokenElement={<DefaultImage src="default-photo.svg" />}>
|
|
|
|
|
|
+ <PhotoProvider brokenElement={<DefaultImage src={defaultPhoto} />}>
|
|
<PhotoConsumer src="">
|
|
<PhotoConsumer src="">
|
|
<Button>自定义默认图</Button>
|
|
<Button>自定义默认图</Button>
|
|
</PhotoConsumer>
|
|
</PhotoConsumer>
|
|
@@ -90,6 +75,22 @@ import {
|
|
</Story>
|
|
</Story>
|
|
</Preview>
|
|
</Preview>
|
|
|
|
|
|
|
|
+## 两张预览
|
|
|
|
+
|
|
|
|
+<Preview>
|
|
|
|
+ <Story name="两张预览">
|
|
|
|
+ <PhotoProvider>
|
|
|
|
+ <ImageList>
|
|
|
|
+ {photoImages.map((item, index) => (
|
|
|
|
+ <PhotoConsumer key={index} src={item}>
|
|
|
|
+ {index < 2 ? <ViewBox viewImage={item} /> : undefined}
|
|
|
|
+ </PhotoConsumer>
|
|
|
|
+ ))}
|
|
|
|
+ </ImageList>
|
|
|
|
+ </PhotoProvider>
|
|
|
|
+ </Story>
|
|
|
|
+</Preview>
|
|
|
|
+
|
|
# Props
|
|
# Props
|
|
|
|
|
|
### PhotoProvider
|
|
### PhotoProvider
|