Commit 408b6950469396186a3e891d520565c19371977a
update table example
Showing
7 changed files
with
27 additions
and
17 deletions
Show diff stats
examples/routers/table.vue
... | ... | @@ -92,7 +92,8 @@ |
92 | 92 | { |
93 | 93 | title: 'Postcode', |
94 | 94 | key: 'zip', |
95 | - width: 100 | |
95 | + width: 100, | |
96 | + fixed: 'right', | |
96 | 97 | }, |
97 | 98 | { |
98 | 99 | title: 'Action', |
... | ... | @@ -239,4 +240,4 @@ |
239 | 240 | } |
240 | 241 | } |
241 | 242 | } |
242 | 243 | -</script> |
244 | +</script> | |
243 | 245 | \ No newline at end of file |
... | ... |
src/components/date-picker/panel/Date/date-range.vue
... | ... | @@ -295,9 +295,7 @@ |
295 | 295 | const otherPanel = panel === 'left' ? 'right' : 'left'; |
296 | 296 | const otherCurrent = new Date(this[`${otherPanel}PanelDate`]); |
297 | 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 | 301 | showYearPicker (panel) { |
... | ... |
src/components/date-picker/picker.vue
... | ... | @@ -334,7 +334,7 @@ |
334 | 334 | if (typeof val === 'string') { |
335 | 335 | val = parser(val, format); |
336 | 336 | } else if (type === 'timerange') { |
337 | - val = parser(val, format); | |
337 | + val = parser(val, format).map(v => v || ''); | |
338 | 338 | } else { |
339 | 339 | val = val.map(date => new Date(date)); // try to parse |
340 | 340 | val = val.map(date => isNaN(date.getTime()) ? null : date); // check if parse passed |
... | ... |
src/components/poptip/poptip.vue
... | ... | @@ -97,6 +97,9 @@ |
97 | 97 | transfer: { |
98 | 98 | type: Boolean, |
99 | 99 | default: false |
100 | + }, | |
101 | + popperClass: { | |
102 | + type: String | |
100 | 103 | } |
101 | 104 | }, |
102 | 105 | data () { |
... | ... | @@ -120,7 +123,8 @@ |
120 | 123 | return [ |
121 | 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 | 1 | <template> |
2 | 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 | 4 | <template v-if="renderType === 'selection'"> |
5 | 5 | <Checkbox :value="checked" @click.native.stop="handleClick" @on-change="toggleSelect" :disabled="disabled"></Checkbox> |
6 | 6 | </template> |
... | ... |
src/components/table/table-head.vue
... | ... | @@ -23,6 +23,8 @@ |
23 | 23 | v-if="isPopperShow(column)" |
24 | 24 | v-model="column._filterVisible" |
25 | 25 | placement="bottom" |
26 | + popper-class="ivu-table-popper" | |
27 | + transfer | |
26 | 28 | @on-popper-hide="handleFilterHide(column._index)"> |
27 | 29 | <span :class="[prefixCls + '-filter']"> |
28 | 30 | <i class="ivu-icon ivu-icon-funnel" :class="{on: column._isFiltered}"></i> |
... | ... |
src/styles/components/table.less
... | ... | @@ -357,15 +357,13 @@ |
357 | 357 | &-footer{ |
358 | 358 | padding: 4px; |
359 | 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 | 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 | 391 | \ No newline at end of file |
... | ... |