return ‘demo-table-row’;
}
if (row.age === 18) {
return ‘demo-table-row’;
}
return ‘’;
}
}
列
通过给列 columns 设置字段 className 可以给某一列指定一个样式。
.ivu-table td.demo-table-column{
background-color: #2db7f5;
color: #fff;
}
data () {
return {
columnsCol: [
{
title: ‘Name’,
key: ‘name’
},
{
title: ‘Age’,
key: ‘age’,
className: ‘demo-table-column’
}
],
dataCol: [
{
name: ‘lee’,
age: 18
},
{
name: ‘hello’,
age: 21
}
],
}
},
二、滚动条
纵向滚动条
横向滚动条
当所有列的宽度超出table父元素或本身定义的宽度时出现
columns: [
{
title: ‘Name’,
key: ‘name’,
width: 400,
},
{
title: ‘Age’,
key: ‘age’,
minWidth: 500
}
],
三、固定列
columns: [
{
title: ‘Name’,
key: ‘name’,
width: 100,
fixed: ‘left’