mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:29:24 +08:00
Merge pull request #5530 from sqzhou/fix-transfer
fix:修复时间类、Transfer的事件动作
This commit is contained in:
commit
2391bd5849
@ -851,6 +851,7 @@ icon:
|
||||
| 事件名称 | 事件参数 | 说明 |
|
||||
| -------- | --------------------------------- | ---------------- |
|
||||
| change | `event.data.value: string` 选中值 | 选中值变化时触发 |
|
||||
| selectAll | `event.data.options: Array<Options>` | 全选时触发 |
|
||||
|
||||
## 动作表
|
||||
|
||||
|
@ -423,8 +423,8 @@ export default class DateControl extends React.PureComponent<
|
||||
// 派发有event的事件
|
||||
@autobind
|
||||
dispatchEvent(e: React.SyntheticEvent<HTMLElement>) {
|
||||
const {dispatchEvent, data} = this.props;
|
||||
dispatchEvent(e, data);
|
||||
const {dispatchEvent, data, value} = this.props;
|
||||
dispatchEvent(e, createObject(data, {value}));
|
||||
}
|
||||
|
||||
// 动作
|
||||
|
@ -386,8 +386,8 @@ export class BaseTransferRenderer<
|
||||
|
||||
@autobind
|
||||
onSelectAll(options: Option[]) {
|
||||
const {dispatchEvent} = this.props;
|
||||
dispatchEvent('selectAll', options);
|
||||
const {dispatchEvent, data} = this.props;
|
||||
dispatchEvent('selectAll', createObject(data, {options}));
|
||||
}
|
||||
|
||||
// 动作
|
||||
|
@ -3,7 +3,7 @@ import React from 'react';
|
||||
import {Spinner} from 'amis-ui';
|
||||
import {BaseTransferRenderer, TransferControlSchema} from './Transfer';
|
||||
import {TransferPicker} from 'amis-ui';
|
||||
import {autobind} from 'amis-core';
|
||||
import {autobind, createObject} from 'amis-core';
|
||||
import {ActionObject} from 'amis-core';
|
||||
|
||||
/**
|
||||
@ -41,8 +41,8 @@ export interface TabsTransferProps
|
||||
export class TransferPickerRenderer extends BaseTransferRenderer<TabsTransferProps> {
|
||||
@autobind
|
||||
dispatchEvent(name: string) {
|
||||
const {dispatchEvent, data} = this.props;
|
||||
dispatchEvent(name, data);
|
||||
const {dispatchEvent, data, value} = this.props;
|
||||
dispatchEvent(name, createObject(data, {value}));
|
||||
}
|
||||
|
||||
// 动作
|
||||
|
Loading…
Reference in New Issue
Block a user