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', title: 'Postcode',
key: 'zip', key: 'zip',
width: 100 width: 100,
fixed: 'right',
}, },
{ {
title: 'Action', title: 'Action',
@ -239,4 +240,4 @@
} }
} }
} }
</script> </script>

View file

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

View file

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

View file

@ -97,6 +97,9 @@
transfer: { transfer: {
type: Boolean, type: Boolean,
default: false default: false
},
popperClass: {
type: String
} }
}, },
data () { data () {
@ -120,7 +123,8 @@
return [ return [
`${prefixCls}-popper`, `${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> <template>
<div :class="classes" ref="cell"> <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'"> <template v-if="renderType === 'selection'">
<Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox> <Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox>
</template> </template>

View file

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

View file

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