el-upload.js 542 B

1234567891011121314151617
  1. export default {
  2. 'list-type': (h, conf, key) => {
  3. const list = []
  4. const config = conf.__config__
  5. if (conf['list-type'] === 'picture-card') {
  6. list.push(<i class="el-icon-plus"></i>)
  7. } else {
  8. list.push(<el-button size="small" type="primary" icon="el-icon-upload">{config.buttonText}</el-button>)
  9. }
  10. if (config.showTip) {
  11. list.push(
  12. <div slot="tip" class="el-upload__tip">只能上传不超过 {config.fileSize}{config.sizeUnit} 的{conf.accept}文件</div>
  13. )
  14. }
  15. return list
  16. }
  17. }