diff --git a/fis-conf.js b/fis-conf.js index 71396696b..e98a643c8 100644 --- a/fis-conf.js +++ b/fis-conf.js @@ -12,7 +12,8 @@ fis.set('project.ignore', [ 'scripts/**', 'npm/**', 'gh-pages/**', - '.*/**' + '.*/**', + 'node_modules/**' ]); // 配置只编译哪些文件。 diff --git a/package.json b/package.json index 474048aa4..78e34465e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "fis-optimizer-terser": "^1.0.1", "fis-parser-sass": "^1.2.0", "fis-parser-svgr": "^1.0.0", - "fis3": "^3.4.41", + "fis3": "^3.5.0-beta.2", "fis3-deploy-skip-packed": "0.0.5", "fis3-hook-commonjs": "^0.1.31", "fis3-hook-node_modules": "^2.3.1", diff --git a/packages/amis-core/src/utils/validations.ts b/packages/amis-core/src/utils/validations.ts index b16afd055..38b5bba7a 100644 --- a/packages/amis-core/src/utils/validations.ts +++ b/packages/amis-core/src/utils/validations.ts @@ -170,6 +170,11 @@ export const validations: { return validations.matchRegexp(values, value, /^[A-Z\s\u00C0-\u017F]+$/i); }, isLength: function (values, value, length) { + // 此方法应该判断文本长度,如果传入数据为number,导致 maxLength 和 maximum 表现一致了,默认转成string + if (typeof value === 'number') { + value = String(value); + } + return !isExisty(value) || isEmpty(value) || value.length === length; }, equals: function (values, value, eql) { @@ -186,6 +191,10 @@ export const validations: { return !isExisty(value) || value.length <= length; }, minLength: function (values, value, length) { + // 此方法应该判断文本长度,如果传入数据为number,导致 maxLength 和 maximum 表现一致了,默认转成string + if (typeof value === 'number') { + value = String(value); + } return !isExisty(value) || isEmpty(value) || value.length >= length; }, isUrlPath: function (values, value, regexp) {