NervJS / taro-ui

一款基于 Taro 框架开发的多端 UI 组件库
https://taro-ui.taro.zone
MIT License
4.54k stars 759 forks source link

AtImagePicker组件,files有默认值的时候,删除图片后无法再选择图片 #1293

Open ZouHuaYi opened 3 years ago

ZouHuaYi commented 3 years ago

"@babel/runtime": "^7.7.7", "@tarojs/cli": "3.0.21", "@tarojs/components": "3.0.21", "@tarojs/react": "3.0.21", "@tarojs/redux": "^2.2.10", "@tarojs/runtime": "3.0.21", "@tarojs/taro": "3.0.21", "react": "^16.10.0", "react-dom": "^16.10.0", "react-redux": "^7.2.2", "redux": "^4.0.5", "redux-logger": "^3.0.6", "redux-thunk": "^2.3.0", "taro-ui": "^3.0.0-alpha.3"

测试代码如下:

import React, {Component} from "react";
import { AtImagePicker } from 'taro-ui'

export default class Index extends Component {
  constructor (props) {
    super(props)
    this.state = {
      files: [{
        url: 'https://jimczj.gitee.io/lazyrepay/aragaki1.jpeg',
      },
        {
          url: 'https://jimczj.gitee.io/lazyrepay/aragaki2.jpeg',
        },
        {
          url: 'https://jimczj.gitee.io/lazyrepay/aragaki3.png',
        }]
    }

  }

  onChange (files) {
    this.setState({
      files
    })
  }
  onFail (mes) {
    console.log(mes)
  }
  onImageClick (index, file) {
    console.log(index, file)
  }
  render () {
    return (
      <AtImagePicker
        files={this.state.files}
        onChange={this.onChange.bind(this)}
      />
    )
  }
}
houta-higuchi commented 3 years ago

没人管了?