mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-05-12 03:23:48 +00:00
补全方法的参数类型、返回值类型与详情说明,规范字段编辑器/字段配置/运行时 API 等文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
3.8 KiB
Markdown
52 lines
3.8 KiB
Markdown
# EventSelect 事件选择器
|
|
|
|
用于配置组件或数据源事件的选择器。
|
|
|
|
::: warning 注意
|
|
此组件仅在编辑器环境中可用,需要配合 `@tmagic/editor` 使用。
|
|
:::
|
|
|
|
## 基础用法
|
|
|
|
```js
|
|
{
|
|
type: 'event-select',
|
|
name: 'events',
|
|
text: '事件配置',
|
|
src: 'component'
|
|
}
|
|
```
|
|
|
|
## 数据源事件
|
|
|
|
```js
|
|
{
|
|
type: 'event-select',
|
|
name: 'events',
|
|
text: '事件配置',
|
|
src: 'datasource'
|
|
}
|
|
```
|
|
|
|
## Attributes
|
|
|
|
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
|
| ---------------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------ |
|
|
| name | 绑定值 | string | — | — |
|
|
| text | 表单标签 | string | — | — |
|
|
| disabled | 是否禁用 | boolean / [FilterFunction](https://github.com/Tencent/tmagic-editor/blob/cce8b63fc3618b5b811aa33c703de21c22be8a6a/packages/form-schema/src/base.ts#L195) | — | false |
|
|
| src | 事件来源 | string | datasource/component | — |
|
|
| labelWidth | 标签宽度 | string | — | — |
|
|
| eventNameConfig | 事件名称表单配置 | FormItem | — | — |
|
|
| actionTypeConfig | 动作类型配置 | FormItem | — | — |
|
|
| targetCompConfig | 联动组件配置 | FormItem | — | — |
|
|
| compActionConfig | 联动组件动作配置 | FormItem | — | — |
|
|
| codeActionConfig | 联动代码配置 | FormItem | — | — |
|
|
| dataSourceActionConfig | 联动数据源配置 | FormItem | — | — |
|
|
| onChange | 值变化时触发的函数 | [OnChangeHandler](https://github.com/Tencent/tmagic-editor/blob/cce8b63fc3618b5b811aa33c703de21c22be8a6a/packages/form-schema/src/base.ts#L30) | — | - |
|
|
|
|
## src说明
|
|
|
|
- `component`: 组件事件
|
|
- `datasource`: 数据源事件
|