mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
chore(amis-editor): 优化 input-number 的 mock 逻辑 (#6583)
* chore(amis-editor): 优化 input-number 的 mock 逻辑 * chore(amis-editor): 优化 input-number 的 mock 逻辑
This commit is contained in:
parent
b71000ba9a
commit
73550fc71b
@ -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') {
|
||||
|
Loading…
Reference in New Issue
Block a user