1.0.0 • Published 2 years ago

@alilc/lowcode-setter-behavior v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Behavior Setter

@alilc/lowcode-setter-behavior

API

参数名说明必填类型默认值备注
field引擎传入属性trueSettingTarget--
onChange引擎传入属性,setter 值变化需要调用 onChange 告知引擎true(value: any) => void--
actions待配置的事件列表truestring[]'onActionClick', 'onClick'
typelink or modal or bothfalsestring-
value引擎传入属性,当前值trueany-
url当前搭建平台获取页面列表的 apifalsestring
responseFormatter当前搭建平台获取页面列表 api 的返回值处理函数,要将返回值处理成 { label: string, value: any }false(response: any) => ({ label: string, value: any })-
extraBehaviorActions自定义交互falseBehaviorAction

Interfaces

export interface BehaviorAction<Value = Record<string, any>, Options = Record<string, any>> {
  /** 行为key */
  name: string;
  /** 行为名字,显示在RadioGroup选项 */
  title: string;
  /** 选项渲染 */
  render?: (props: BehaviorActionProps<Value, Options>) => React.ReactNode;
  /** 值序列化为低代码协议的值 */
  toActionValue: (value: Value) => any;
}