jd-opensource / jd-opensource/taro-ui

图片预览 点击 移除 又自动打开 图片选择picker

Open
#1,132 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.7k
Forks
740
PR merge metrics
No merged PRs in 30d

Description

https://github.com/NervJS/taro-ui/blob/e59358d72b691c368080a40dab0c4641b5db3018/src/components/image-picker/index.tsx#L85

``` js
private handleRemoveImg = (idx: number,e:any): void => {
e.preventDefault();
e.stopPropagation();
const { files = [] } = this.props
if (ENV === Taro.ENV_TYPE.WEB) {
window.URL.revokeObjectURL(files[idx].url)
}
const newFiles = files.filter((_, i) => i !== idx)
this.props.onChange(newFiles, 'remove', idx)
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.