diff --git a/components/table/FilterDropdownMenuWrapper.jsx b/components/table/FilterDropdownMenuWrapper.jsx index 08ea7a98a..ee1862ca9 100644 --- a/components/table/FilterDropdownMenuWrapper.jsx +++ b/components/table/FilterDropdownMenuWrapper.jsx @@ -1,7 +1,8 @@ export default { methods: { handelClick(e) { - this.$emit('click', e); + e.stopPropagation(); + //this.$emit('click', e); }, }, render() { diff --git a/components/table/Table.jsx b/components/table/Table.jsx index e47f19fce..fa362f519 100755 --- a/components/table/Table.jsx +++ b/components/table/Table.jsx @@ -16,6 +16,7 @@ import { isValidElement, filterEmpty, getAllProps, + getComponentFromProp, } from '../_util/props-util'; import BaseMixin from '../_util/BaseMixin'; import { ConfigConsumerProps } from '../config-provider'; @@ -84,7 +85,11 @@ export default { data() { // this.columns = props.columns || normalizeColumns(props.children) - + const props = getOptionProps(this); + warning( + !('expandedRowRender' in props) || !('scroll' in props), + '`expandedRowRender` and `scroll` are not compatible. Please use one of them at one time.', + ); this.createComponents(this.components); this.CheckboxPropsCache = {}; @@ -92,7 +97,6 @@ export default { selectedRowKeys: getRowSelection(this.$props).selectedRowKeys || [], selectionDirty: false, }); - this.prevRowSelection = this.rowSelection ? { ...this.rowSelection } : this.rowSelection; return { ...this.getDefaultSortOrder(this.columns), // εε°ηΆζ @@ -118,7 +122,7 @@ export default { deep: true, }, rowSelection: { - handler(val) { + handler(val, oldVal) { if (val && 'selectedRowKeys' in val) { this.store.setState({ selectedRowKeys: val.selectedRowKeys || [], @@ -127,12 +131,11 @@ export default { if (rowSelection && val.getCheckboxProps !== rowSelection.getCheckboxProps) { this.CheckboxPropsCache = {}; } - } else if (val && !this.prevRowSelection) { + } else if (oldVal && !val) { this.store.setState({ selectedRowKeys: [], }); } - this.prevRowSelection = val ? { ...val } : val; }, deep: true, }, @@ -823,6 +826,7 @@ export default { class={`${prefixCls}-column-sorter-up ${isAscend ? 'on' : 'off'}`} type="caret-up" theme="filled" + key="caret-up" /> ); @@ -831,6 +835,7 @@ export default { class={`${prefixCls}-column-sorter-down ${isDescend ? 'on' : 'off'}`} type="caret-down" theme="filled" + key="caret-down" /> ); diff --git a/components/table/interface.js b/components/table/interface.js index c5d484292..8b61384c4 100644 --- a/components/table/interface.js +++ b/components/table/interface.js @@ -114,7 +114,7 @@ export const TableProps = { // onExpand?: (expanded: boolean, record: T) => void; // onChange?: (pagination: PaginationProps | boolean, filters: string[], sorter: Object) => any; loading: PropTypes.oneOfType([PropTypes.shape(SpinProps).loose, PropTypes.bool]), - locale: PropTypes.object, + locale: TableLocale, indentSize: PropTypes.number, // onRowClick?: (record: T, index: number, event: Event) => any; customRow: PropTypes.func, diff --git a/components/tabs/__tests__/__snapshots__/demo.test.js.snap b/components/tabs/__tests__/__snapshots__/demo.test.js.snap index a32bfe7dd..e6099dcb1 100644 --- a/components/tabs/__tests__/__snapshots__/demo.test.js.snap +++ b/components/tabs/__tests__/__snapshots__/demo.test.js.snap @@ -142,7 +142,7 @@ exports[`renders ./components/tabs/demo/custom-add-trigger.md correctly 1`] = ` exports[`renders ./components/tabs/demo/custom-tab-bar.md correctly 1`] = `