Merge pull request #2096 from QingWei-Li/fix/table-scrollbar

Table: fix test fix #2090 , remove virtual scrollbar
pull/2089/head
baiyaaaaa 2016-12-30 11:36:28 +08:00 committed by GitHub
commit 42eb169e4f
6 changed files with 9 additions and 12 deletions

View File

@ -1453,7 +1453,6 @@ When the row content is too long and you do not want to display the horizontal s
| empty-text | Displayed text when data is empty. You can customize this area with `slot="empty"` | String | — | No Data |
| default-expand-all | whether expand all rows by default, only works when the table has a column type="expand" | Boolean | — | false |
| expand-row-keys | set expanded rows by this prop, prop's value is the keys of expand rows, you should set row-key before using this prop | Array | — | |
| virtual-scrollbar | Enable virtual scrollbar | Boolean | — | false |
### Table Events
| Event Name | Description | Parameters |

View File

@ -1475,7 +1475,6 @@
| empty-text | 空数据时显示的文本内容,也可以通过 `slot="empty"` 设置 | String | — | 暂无数据 |
| default-expand-all | 是否默认展开所有行,当 Table 中存在 type="expand" 的 Column 的时候有效 | Boolean | — | false |
| expand-row-keys | 可以通过该属性设置 Table 目前的展开行,需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。| Array | — | |
| virtual-scrollbar | 启用虚拟滚动条 | Boolean | — | false |
### Table Events

View File

@ -1,6 +1,7 @@
import { on, off } from 'element-ui/src/utils/dom';
import { renderThumbStyle, BAR_MAP } from './util';
/* istanbul ignore next */
export default {
name: 'Bar',

View File

@ -5,6 +5,7 @@ import scrollbarWidth from 'element-ui/src/utils/scrollbar-width';
import * as util from './util';
import Bar from './bar';
/* istanbul ignore next */
export default {
name: 'ElScrollbar',

View File

@ -124,7 +124,7 @@ export default {
minWidth: {},
renderHeader: Function,
sortable: {
type: [Boolean, String],
type: [String, Boolean],
default: false
},
sortMethod: Function,
@ -222,14 +222,14 @@ export default {
context: this.context,
align: this.align ? 'is-' + this.align : null,
headerAlign: this.headerAlign ? 'is-' + this.headerAlign : (this.align ? 'is-' + this.align : null),
sortable: this.sortable,
sortable: this.sortable === '' ? true : this.sortable,
sortMethod: this.sortMethod,
resizable: this.resizable,
showOverflowTooltip: this.showOverflowTooltip || this.showTooltipWhenOverflow,
formatter: this.formatter,
selectable: this.selectable,
reserveSelection: this.reserveSelection,
fixed: this.fixed,
fixed: this.fixed === '' ? true : this.fixed,
filterMethod: this.filterMethod,
filters: this.filters,
filterable: this.filters || this.filterMethod,

View File

@ -18,11 +18,10 @@
:style="{ width: layout.bodyWidth ? layout.bodyWidth + 'px' : '' }">
</table-header>
</div>
<el-scrollbar
<div
class="el-table__body-wrapper"
ref="bodyWrapper"
:native="!virtualScrollbar"
:wrap-style="[bodyHeight]">
:style="[bodyHeight]">
<table-body
:context="context"
:store="store"
@ -35,7 +34,7 @@
<div class="el-table__empty-block" v-if="!data || data.length === 0">
<span class="el-table__empty-text"><slot name="empty">{{ emptyText || t('el.table.emptyText') }}</slot></span>
</div>
</el-scrollbar>
</div>
<div class="el-table__fixed" ref="fixedWrapper"
v-if="fixedColumns.length > 0"
:style="[
@ -133,8 +132,6 @@
width: [String, Number],
virtualScrollbar: Boolean,
height: [String, Number],
maxHeight: [String, Number],
@ -249,7 +246,7 @@
computed: {
bodyWrapper() {
return this.$refs.bodyWrapper.wrap;
return this.$refs.bodyWrapper;
},
shouldUpdateHeight() {