chore(amis-editor): 优化 input-number 的 mock 逻辑 (#6583)

* chore(amis-editor): 优化 input-number 的 mock 逻辑

* chore(amis-editor): 优化 input-number 的 mock 逻辑
This commit is contained in:
liaoxuezhi 2023-04-12 14:27:12 +08:00 committed by GitHub
parent b71000ba9a
commit 73550fc71b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,11 @@ export function mockValue(schema: any) {
schema.type === 'input-month'
) {
return moment().format('X');
} else if (schema.type === 'number' || schema.type === 'input-number') {
const precision = schema.precision || 0;
return precision
? (Math.random() * 10000).toFixed(precision)
: Math.random() * 10000;
} else if (schema.type === 'image' || schema.type === 'static-image') {
return placeholderImage;
} else if (schema.type === 'images' || schema.type === 'static-images') {