diff --git a/src/layui.js b/src/layui.js index 8afff3e5..9108e13e 100644 --- a/src/layui.js +++ b/src/layui.js @@ -171,7 +171,7 @@ video: '视频', audio: '音频' }, - prompt: { + validateMessages: { fileExtensionError: '选择的{fileType}中包含不支持的格式', filesOverLengthLimit: '同时最多只能上传: {length} 个文件', currentFilesLength: '您当前已经选择了: {length} 个文件', diff --git a/src/modules/upload.js b/src/modules/upload.js index a7fcc41d..0f49b21c 100644 --- a/src/modules/upload.js +++ b/src/modules/upload.js @@ -572,7 +572,7 @@ layui.define(['lay', 'layer'], function(exports) { // 校验失败提示 if(check){ - that.msg(text['check-error'] || layui.$t('lay.upload.prompt.fileExtensionError', {fileType: typeName})); + that.msg(text['check-error'] || layui.$t('lay.upload.validateMessages.fileExtensionError', {fileType: typeName})); return elemFile.value = ''; } @@ -598,9 +598,9 @@ layui.define(['lay', 'layer'], function(exports) { return that.msg(typeof text['limit-number'] === 'function' ? text['limit-number'](options, that.fileLength) : ( - layui.$t('lay.upload.prompt.filesOverLengthLimit', {length: options.number}) + layui.$t('lay.upload.validateMessages.filesOverLengthLimit', {length: options.number}) + '
' - + layui.$t('lay.upload.prompt.currentFilesLength', {length: that.fileLength}) + + layui.$t('lay.upload.validateMessages.currentFilesLength', {length: that.fileLength}) )); } @@ -619,7 +619,7 @@ layui.define(['lay', 'layer'], function(exports) { if(limitSize) return that.msg( typeof text['limit-size'] === 'function' ? text['limit-size'](options, limitSize) - : layui.$t('lay.upload.prompt.fileOverSizeLimit', {size: limitSize})); + : layui.$t('lay.upload.validateMessages.fileOverSizeLimit', {size: limitSize})); } send();