Skip to content

Commit

Permalink
💡 docs(leva-panel): 补充props 注释
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jun 14, 2023
1 parent 77ccfe1 commit af0b2e5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/LevaPanel/Schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,28 @@ import { ReactNode, memo, useEffect, useMemo } from 'react';

import { SchemaItem, toLevaSchema } from './utils/schema';

/**
* 用于生成表单的 schema 配置项
* @template T - 表单数据类型
*/
export interface SchemaProps<T> {
/**
* JSON Schema 配置项
*/
schema: JSONSchema<T>;
/**
* 表单默认值
*/
defaultValue?: T;
/**
* 表单当前值
*/
value?: T;
/**
* 表单值变化的回调函数
* @param changedValue - 变化的部分值
* @param fullValue - 完整的表单值
*/
onChange?: (changedValue: Partial<T>, fullValue: T) => void;
}

Expand Down

0 comments on commit af0b2e5

Please sign in to comment.