Commit 408b6950469396186a3e891d520565c19371977a

Authored by huanghong
2 parents b08bd8a8 4ad72493

update table example

examples/routers/table.vue
@@ -92,7 +92,8 @@ @@ -92,7 +92,8 @@
92 { 92 {
93 title: 'Postcode', 93 title: 'Postcode',
94 key: 'zip', 94 key: 'zip',
95 - width: 100 95 + width: 100,
  96 + fixed: 'right',
96 }, 97 },
97 { 98 {
98 title: 'Action', 99 title: 'Action',
@@ -239,4 +240,4 @@ @@ -239,4 +240,4 @@
239 } 240 }
240 } 241 }
241 } 242 }
242 -</script> 243 -</script>
  244 +</script>
243 \ No newline at end of file 245 \ No newline at end of file
src/components/date-picker/panel/Date/date-range.vue
@@ -295,9 +295,7 @@ @@ -295,9 +295,7 @@
295 const otherPanel = panel === 'left' ? 'right' : 'left'; 295 const otherPanel = panel === 'left' ? 'right' : 'left';
296 const otherCurrent = new Date(this[`${otherPanel}PanelDate`]); 296 const otherCurrent = new Date(this[`${otherPanel}PanelDate`]);
297 otherCurrent[`set${type}`](otherCurrent[`get${type}`]() + increment); 297 otherCurrent[`set${type}`](otherCurrent[`get${type}`]() + increment);
298 - if (current[`get${type}`]() !== otherCurrent[`get${type}`]()){  
299 - this[`${otherPanel}PanelDate`] = otherCurrent;  
300 - } 298 + this[`${otherPanel}PanelDate`] = otherCurrent;
301 } 299 }
302 }, 300 },
303 showYearPicker (panel) { 301 showYearPicker (panel) {
src/components/date-picker/picker.vue
@@ -334,7 +334,7 @@ @@ -334,7 +334,7 @@
334 if (typeof val === 'string') { 334 if (typeof val === 'string') {
335 val = parser(val, format); 335 val = parser(val, format);
336 } else if (type === 'timerange') { 336 } else if (type === 'timerange') {
337 - val = parser(val, format); 337 + val = parser(val, format).map(v => v || '');
338 } else { 338 } else {
339 val = val.map(date => new Date(date)); // try to parse 339 val = val.map(date => new Date(date)); // try to parse
340 val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed 340 val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed
src/components/poptip/poptip.vue
@@ -97,6 +97,9 @@ @@ -97,6 +97,9 @@
97 transfer: { 97 transfer: {
98 type: Boolean, 98 type: Boolean,
99 default: false 99 default: false
  100 + },
  101 + popperClass: {
  102 + type: String
100 } 103 }
101 }, 104 },
102 data () { 105 data () {
@@ -120,7 +123,8 @@ @@ -120,7 +123,8 @@
120 return [ 123 return [
121 `${prefixCls}-popper`, 124 `${prefixCls}-popper`,
122 { 125 {
123 - [`${prefixCls}-confirm`]: this.transfer && this.confirm 126 + [`${prefixCls}-confirm`]: this.transfer && this.confirm,
  127 + [`${this.popperClass}`]: !!this.popperClass
124 } 128 }
125 ]; 129 ];
126 }, 130 },
src/components/table/cell.vue
1 <template> 1 <template>
2 <div :class="classes" ref="cell"> 2 <div :class="classes" ref="cell">
3 - <template v-if="renderType === 'index'">{{naturalIndex + 1}}</template> 3 + <template v-if="renderType === 'index'"><span>{{naturalIndex + 1}}</span></template>
4 <template v-if="renderType === 'selection'"> 4 <template v-if="renderType === 'selection'">
5 <Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox> 5 <Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox>
6 </template> 6 </template>
src/components/table/table-head.vue
@@ -23,6 +23,8 @@ @@ -23,6 +23,8 @@
23 v-if="isPopperShow(column)" 23 v-if="isPopperShow(column)"
24 v-model="column._filterVisible" 24 v-model="column._filterVisible"
25 placement="bottom" 25 placement="bottom"
  26 + popper-class="ivu-table-popper"
  27 + transfer
26 @on-popper-hide="handleFilterHide(column._index)"> 28 @on-popper-hide="handleFilterHide(column._index)">
27 <span :class="[prefixCls + '-filter']"> 29 <span :class="[prefixCls + '-filter']">
28 <i class="ivu-icon ivu-icon-funnel" :class="{on: column._isFiltered}"></i> 30 <i class="ivu-icon ivu-icon-funnel" :class="{on: column._isFiltered}"></i>
src/styles/components/table.less
@@ -357,15 +357,13 @@ @@ -357,15 +357,13 @@
357 &-footer{ 357 &-footer{
358 padding: 4px; 358 padding: 4px;
359 border-top: 1px solid @border-color-split; 359 border-top: 1px solid @border-color-split;
360 - }  
361 - }  
362 - .ivu-poptip-popper{  
363 - min-width: 0;  
364 - text-align: left;  
365 - }  
366 - thead .ivu-poptip-popper{  
367 - .ivu-poptip-body{  
368 - padding: 0; 360 + overflow: hidden;
  361 + button:first-child{
  362 + float: left;
  363 + }
  364 + button:last-child{
  365 + float: right;
  366 + }
369 } 367 }
370 } 368 }
371 369
@@ -383,3 +381,10 @@ @@ -383,3 +381,10 @@
383 visibility: hidden; 381 visibility: hidden;
384 } 382 }
385 } 383 }
  384 +.ivu-table-popper{
  385 + min-width: 0;
  386 + text-align: left;
  387 + .ivu-poptip-body{
  388 + padding: 0;
  389 + }
  390 +}
386 \ No newline at end of file 391 \ No newline at end of file