8000
Skip to content

新增 ImagePreview;Dialog国际化&单元测试#244

Merged
oasis-cloud merged 5 commits intojdf2e:mainfrom
yangjinjun3:main
Aug 30, 2022
Merged

新增 ImagePreview;Dialog国际化&单元测试#244
oasis-cloud merged 5 commits intojdf2e:mainfrom
yangjinjun3:main

Conversation

@yangjinjun3
Copy link
Copy Markdown
Contributor

新增 ImagePreview;
Dialog国际化&单元测试

Comment thread src/packages/imagepreview/doc.md Outdated
| videos | 预览的视频数组(视频自动放到图片之前、taro场景暂不支持) | Array<`Object`> | []
| images | 预览图片数组 | { src: String }[] | []
| autoplay | 自动轮播时长,0表示不会自动轮播 | Number、String | 3000 |
| init-no | 初始页码 | Number | 1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

props驼峰式

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Comment thread src/packages/imagepreview/doc.en-US.md Outdated
| videos | Videos Array(Videos are before images, not support in taro) | Array<`Object`> | []
| images | Images array | Array<`String`> | []
| autoplay | Autoplay time, zero means not autoplay | Number、String | 3000 |
| init-no | Init no | Number | 1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

props驼峰式

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

Comment thread src/packages/imagepreview/doc.en-US.md Outdated
return (
<>
<ImagePreview images={images} show={showPreview1} >
<Cell title="展示图片预览" isLink={true} >
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title改成英文,其他示例有相同问题

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

})
const [lastTouchEndTime, setLastTouchEndTime] = useState(0) // 用来辅助监听双击

const any) => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类型event: React.TouchEvent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

const [eleImg, setEleImg] = useState(null)
const [active, setActive] = useState(1)
const [maxNo, setMaxNo] = useState(1)
const [options, setOptions] = useState({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没用可删除

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已删除


// event.preventDefault();

const store1 = store as any
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已知类型,尽量不要any
interface IStore {
scale: number
moveable: boolean
oriDistance: number
originScale: number
}
const store1 = store as IStore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

const nutImagePreview = useRef(null)

const [showPop, setShowPop] = useState(false)
const [eleImg, setEleImg] = useState(null)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eleImg 没有用到,是不是 setEleImg 也没什么用?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已删除

@oasis-cloud
6DB6 Copy link
Copy Markdown
Collaborator

适当修正 any 的使用

@oasis-cloud oasis-cloud reopened this Aug 30, 2022
@oasis-cloud oasis-cloud merged commit 68ddaf4 into jdf2e:main Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0