@alilc/lowcode-setter-behavior

交互 setter

Usage no npm install needed!

<script type="module">
  import alilcLowcodeSetterBehavior from 'https://cdn.skypack.dev/@alilc/lowcode-setter-behavior';
</script>

README

Behavior Setter

@alilc/lowcode-setter-behavior

API

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

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;
}