diff --git a/packages/amis-editor-core/src/mocker.ts b/packages/amis-editor-core/src/mocker.ts index 02648a273..26419ee97 100644 --- a/packages/amis-editor-core/src/mocker.ts +++ b/packages/amis-editor-core/src/mocker.ts @@ -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') {