【发布时间】:2019-06-19 06:23:02
【问题描述】:
我使用 reakt 照片库库;我的组件获取图像数组作为道具,并将其转换为具有字段 {src、width、height} 的对象数组。一切正常,但问题是我有一个特定的块高度,画廊应该插入其中。块的高度明显小于画廊整个块的高度,所以我假设图片会水平滚动,并且它们仍然继续垂直滚动,我该如何进行水平滚动?
import React from 'react';
import Gallerys from 'react-photo-gallery';
const Content = styled.div`
height: 700px;
width: auto;
overflow-x: scroll;
img {
border-radius:10px;
}
`;
class Gallery extends React.Component {
render() {
return (
<Content>
<Gallerys direction={'row'} margin={40} photos={images} />
</Content>
);
}
}
export default Gallery;
【问题讨论】:
标签: reactjs typescript