Skip to content

Commit d42300b

Browse files
committed
cr table & tabs
1 parent f5a340c commit d42300b

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

components/table/FilterDropdownMenuWrapper.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export default {
22
methods: {
33
handelClick(e) {
4-
this.$emit('click', e);
4+
e.stopPropagation();
5+
//this.$emit('click', e);
56
},
67
},
78
render() {

components/table/Table.jsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
isValidElement,
1717
filterEmpty,
1818
getAllProps,
19+
getComponentFromProp,
1920
} from '../_util/props-util';
2021
import BaseMixin from '../_util/BaseMixin';
2122
import { ConfigConsumerProps } from '../config-provider';
@@ -84,15 +85,18 @@ export default {
8485

8586
data() {
8687
// this.columns = props.columns || normalizeColumns(props.children)
87-
88+
const props = getOptionProps(this);
89+
warning(
90+
!('expandedRowRender' in props) || !('scroll' in props),
91+
'`expandedRowRender` and `scroll` are not compatible. Please use one of them at one time.',
92+
);
8893
this.createComponents(this.components);
8994
this.CheckboxPropsCache = {};
9095

9196
this.store = createStore({
9297
selectedRowKeys: getRowSelection(this.$props).selectedRowKeys || [],
9398
selectionDirty: false,
9499
});
95-
this.prevRowSelection = this.rowSelection ? { ...this.rowSelection } : this.rowSelection;
96100
return {
97101
...this.getDefaultSortOrder(this.columns),
98102
// 减少状态
@@ -118,7 +122,7 @@ export default {
118122
deep: true,
119123
},
120124
rowSelection: {
121-
handler(val) {
125+
handler(val, oldVal) {
122126
if (val && 'selectedRowKeys' in val) {
123127
this.store.setState({
124128
selectedRowKeys: val.selectedRowKeys || [],
@@ -127,12 +131,11 @@ export default {
127131
if (rowSelection && val.getCheckboxProps !== rowSelection.getCheckboxProps) {
128132
this.CheckboxPropsCache = {};
129133
}
130-
} else if (val && !this.prevRowSelection) {
134+
} else if (oldVal && !val) {
131135
this.store.setState({
132136
selectedRowKeys: [],
133137
});
134138
}
135-
this.prevRowSelection = val ? { ...val } : val;
136139
},
137140
deep: true,
138141
},
@@ -823,6 +826,7 @@ export default {
823826
class={`${prefixCls}-column-sorter-up ${isAscend ? 'on' : 'off'}`}
824827
type="caret-up"
825828
theme="filled"
829+
key="caret-up"
826830
/>
827831
);
828832

@@ -831,6 +835,7 @@ export default {
831835
class={`${prefixCls}-column-sorter-down ${isDescend ? 'on' : 'off'}`}
832836
type="caret-down"
833837
theme="filled"
838+
key="caret-down"
834839
/>
835840
);
836841

components/table/interface.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const TableProps = {
114114
// onExpand?: (expanded: boolean, record: T) => void;
115115
// onChange?: (pagination: PaginationProps | boolean, filters: string[], sorter: Object) => any;
116116
loading: PropTypes.oneOfType([PropTypes.shape(SpinProps).loose, PropTypes.bool]),
117-
locale: PropTypes.object,
117+
locale: TableLocale,
118118
indentSize: PropTypes.number,
119119
// onRowClick?: (record: T, index: number, event: Event) => any;
120120
customRow: PropTypes.func,

components/tabs/__tests__/__snapshots__/demo.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ exports[`renders ./components/tabs/demo/custom-add-trigger.md correctly 1`] = `
142142
exports[`renders ./components/tabs/demo/custom-tab-bar.md correctly 1`] = `
143143
<div>
144144
<div class="ant-tabs ant-tabs-top ant-tabs-line">
145-
<div role="tablist" tabindex="0" class="ant-tabs-bar ant-tabs-top-bar">
145+
<div role="tablist" tabindex="0" class="ant-tabs-bar ant-tabs-top-bar" style="z-index: 1; background: rgb(255, 255, 255);">
146146
<div class="ant-tabs-nav-container"><span unselectable="unselectable" class="ant-tabs-tab-prev ant-tabs-tab-btn-disabled"><span class="ant-tabs-tab-prev-icon"><i aria-label="icon: left" class="ant-tabs-tab-prev-icon-target anticon anticon-left"><svg viewBox="64 64 896 896" data-icon="left" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"></path></svg></i></span></span><span unselectable="unselectable" class="ant-tabs-tab-next ant-tabs-tab-btn-disabled"><span class="ant-tabs-tab-next-icon"><i aria-label="icon: right" class="ant-tabs-tab-next-icon-target anticon anticon-right"><svg viewBox="64 64 896 896" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" class=""><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path></svg></i></span></span>
147147
<div class="ant-tabs-nav-wrap">
148148
<div class="ant-tabs-nav-scroll">

components/tabs/demo/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Icon from './icon';
1010
import Position from './position';
1111
import Size from './size';
1212
import Slide from './slide';
13-
import CustomTabBar from './custom-tab-bar';
13+
// import CustomTabBar from './custom-tab-bar';
1414
import CN from '../index.zh-CN.md';
1515
import US from '../index.en-US.md';
1616
@@ -64,7 +64,6 @@ export default {
6464
<EditableCard />
6565
<CardTop />
6666
<CustomAddTrigger />
67-
<CustomTabBar />
6867
<api>
6968
<template slot='cn'>
7069
<CN/>

0 commit comments

Comments
 (0)