cr table & tabs

pull/1225/head
tangjinzhou 5 years ago
parent f5a340c306
commit d42300bb88

@ -1,7 +1,8 @@
export default {
methods: {
handelClick(e) {
this.$emit('click', e);
e.stopPropagation();
//this.$emit('click', e);
},
},
render() {

@ -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"
/>
);

@ -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,

@ -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`] = `
<div>
<div class="ant-tabs ant-tabs-top ant-tabs-line">
<div role="tablist" tabindex="0" class="ant-tabs-bar ant-tabs-top-bar">
<div role="tablist" tabindex="0" class="ant-tabs-bar ant-tabs-top-bar" style="z-index: 1; background: rgb(255, 255, 255);">
<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>
<div class="ant-tabs-nav-wrap">
<div class="ant-tabs-nav-scroll">

@ -10,7 +10,7 @@ import Icon from './icon';
import Position from './position';
import Size from './size';
import Slide from './slide';
import CustomTabBar from './custom-tab-bar';
// import CustomTabBar from './custom-tab-bar';
import CN from '../index.zh-CN.md';
import US from '../index.en-US.md';
@ -64,7 +64,6 @@ export default {
<EditableCard />
<CardTop />
<CustomAddTrigger />
<CustomTabBar />
<api>
<template slot='cn'>
<CN/>

Loading…
Cancel
Save