iview/src/components/table/mixin.js

18 lines
833 B
JavaScript
Raw Normal View History

2016-11-24 15:27:46 +08:00
export default {
methods: {
alignCls (column) {
2016-11-30 13:17:55 +08:00
return [
{
[`${this.prefixCls}-column-${column.align}`]: column.align,
[`${this.prefixCls}-hidden`]: (this.fixed === 'left' && column.fixed !== 'left') || (this.fixed === 'right' && column.fixed !== 'right') || (!this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right'))
}
]
},
isPopperShow (column) {
return column.filters && ((!this.fixed && !column.fixed) || (this.fixed === 'left' && column.fixed === 'left') || (this.fixed === 'right' && column.fixed === 'right'));
},
setCellWidth (index) {
return this.column[index].width ? this.column.width : this.columnsWidth[index];
2016-11-24 15:27:46 +08:00
}
}
}