mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
根据 itemDraggableOn 控制拖拽按钮是否显示 (#2255)
Co-authored-by: cy <chenyi08@kuaishou.com>
This commit is contained in:
parent
3589f0bfe0
commit
02bfa4bc6f
@ -3,7 +3,7 @@ import {findDOMNode} from 'react-dom';
|
||||
import {Renderer, RendererProps} from '../../factory';
|
||||
import {SchemaNode, Action, Schema} from '../../types';
|
||||
import forEach from 'lodash/forEach';
|
||||
import {filter} from '../../utils/tpl';
|
||||
import {evalExpression, filter} from '../../utils/tpl';
|
||||
import DropDownButton from '../DropDownButton';
|
||||
import Checkbox from '../../components/Checkbox';
|
||||
import Button from '../../components/Button';
|
||||
@ -2048,7 +2048,14 @@ export default class Table extends React.Component<TableProps, object> {
|
||||
}
|
||||
|
||||
renderActions(region: string) {
|
||||
let {actions, render, store, classnames: cx, data} = this.props;
|
||||
let {
|
||||
actions,
|
||||
render,
|
||||
store,
|
||||
classnames: cx,
|
||||
data,
|
||||
itemDraggableOn
|
||||
} = this.props;
|
||||
|
||||
actions = Array.isArray(actions) ? actions.concat() : [];
|
||||
|
||||
@ -2068,7 +2075,8 @@ export default class Table extends React.Component<TableProps, object> {
|
||||
!store.isNested &&
|
||||
region === 'header' &&
|
||||
store.rows.length > 1 &&
|
||||
!~this.renderedToolbars.indexOf('drag-toggler')
|
||||
!~this.renderedToolbars.indexOf('drag-toggler') &&
|
||||
(!itemDraggableOn || evalExpression(itemDraggableOn, data))
|
||||
) {
|
||||
actions.push({
|
||||
type: 'button',
|
||||
|
Loading…
Reference in New Issue
Block a user