diff --git a/src/js/components/form/KLUpload/components/FileUnit/index.html b/src/js/components/form/KLUpload/components/FileUnit/index.html index f7d584ab..2fd1c52f 100644 --- a/src/js/components/form/KLUpload/components/FileUnit/index.html +++ b/src/js/components/form/KLUpload/components/FileUnit/index.html @@ -1,4 +1,4 @@ -
+
{#if type === 'image'}
diff --git a/src/js/components/form/KLUpload/components/UploadBase/index.js b/src/js/components/form/KLUpload/components/UploadBase/index.js index 0f54bea7..09b0a686 100644 --- a/src/js/components/form/KLUpload/components/UploadBase/index.js +++ b/src/js/components/form/KLUpload/components/UploadBase/index.js @@ -174,6 +174,7 @@ const UploadBase = Component.extend({ flag: file.flag, uid: file.uid, status: 'success', + class: file.class || '', }; if (fileunit.flag !== Config.flagMap.DELETED) { @@ -560,7 +561,8 @@ const UploadBase = Component.extend({ Object.keys(typeMap).forEach((key) => { const reg = new RegExp(`${key}$`); - if (reg.test(type) || (!type && reg.test(name))) { + // 名称后缀不区分大小写 + if (reg.test(type) || (!type && reg.test(`${name}`.toLowerCase()))) { typeStr = typeMap[key]; } }); diff --git a/src/js/components/form/KLUpload/index.md b/src/js/components/form/KLUpload/index.md index 893a7055..63845dc7 100644 --- a/src/js/components/form/KLUpload/index.md +++ b/src/js/components/form/KLUpload/index.md @@ -146,8 +146,9 @@ var component = new NEKUI.Component({ template: template, data: { list: [{ - name: 'Game.jpg', - url: 'http://haitao.nos.netease.com/906f417c7c964c0798adf9d0bf1b5c8c.jpg' + name: 'Game.JPG', + url: 'http://haitao.nos.netease.com/906f417c7c964c0798adf9d0bf1b5c8c.jpg', + class: 'my-img-test' }, { name: 'Kaola.jpg', url: 'http://haitao.nos.netease.com/9b73692b3a6b46d2be1de7d3be893834.jpg'