mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
Merge pull request #1122 from 2betop/bugfix2
当 json-editor 字段配置 isJson 验证器且初始值不是字符串时验证失败
This commit is contained in:
commit
7cba2beded
@ -141,7 +141,7 @@ export const validations: {
|
||||
);
|
||||
},
|
||||
isJson: function (values, value, minimum) {
|
||||
if (isExisty(value) && !isEmpty(value)) {
|
||||
if (isExisty(value) && !isEmpty(value) && typeof value === 'string') {
|
||||
try {
|
||||
JSON.parse(value);
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user