update table example

This commit is contained in:
huanghong 2018-03-21 16:11:50 +08:00
commit 408b695046
7 changed files with 27 additions and 17 deletions

View file

@ -92,7 +92,8 @@
{
title: 'Postcode',
key: 'zip',
width: 100
width: 100,
fixed: 'right',
},
{
title: 'Action',

View file

@ -295,10 +295,8 @@
const otherPanel = panel === 'left' ? 'right' : 'left';
const otherCurrent = new Date(this[`${otherPanel}PanelDate`]);
otherCurrent[`set${type}`](otherCurrent[`get${type}`]() + increment);
if (current[`get${type}`]() !== otherCurrent[`get${type}`]()){
this[`${otherPanel}PanelDate`] = otherCurrent;
}
}
},
showYearPicker (panel) {
this[`${panel}PickerTable`] = 'year-table';

View file

@ -334,7 +334,7 @@
if (typeof val === 'string') {
val = parser(val, format);
} else if (type === 'timerange') {
val = parser(val, format);
val = parser(val, format).map(v => v || '');
} else {
val = val.map(date => new Date(date)); // try to parse
val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed

View file

@ -97,6 +97,9 @@
transfer: {
type: Boolean,
default: false
},
popperClass: {
type: String
}
},
data () {
@ -120,7 +123,8 @@
return [
`${prefixCls}-popper`,
{
[`${prefixCls}-confirm`]: this.transfer && this.confirm
[`${prefixCls}-confirm`]: this.transfer && this.confirm,
[`${this.popperClass}`]: !!this.popperClass
}
];
},

View file

@ -1,6 +1,6 @@
<template>
<div :class="classes" ref="cell">
<template v-if="renderType === 'index'">{{naturalIndex + 1}}</template>
<template v-if="renderType === 'index'"><span>{{naturalIndex + 1}}</span></template>
<template v-if="renderType === 'selection'">
<Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox>
</template>

View file

@ -23,6 +23,8 @@
v-if="isPopperShow(column)"
v-model="column._filterVisible"
placement="bottom"
popper-class="ivu-table-popper"
transfer
@on-popper-hide="handleFilterHide(column._index)">
<span :class="[prefixCls + '-filter']">
<i class="ivu-icon ivu-icon-funnel" :class="{on: column._isFiltered}"></i>

View file

@ -357,15 +357,13 @@
&-footer{
padding: 4px;
border-top: 1px solid @border-color-split;
overflow: hidden;
button:first-child{
float: left;
}
button:last-child{
float: right;
}
.ivu-poptip-popper{
min-width: 0;
text-align: left;
}
thead .ivu-poptip-popper{
.ivu-poptip-body{
padding: 0;
}
}
@ -383,3 +381,10 @@
visibility: hidden;
}
}
.ivu-table-popper{
min-width: 0;
text-align: left;
.ivu-poptip-body{
padding: 0;
}
}