行业知识
vue2 ant的a-table组件
2026-12-01 12:52:34
来源:互联网转载
修后的标题(姓名列) {{ index + '-' + '年龄为:' + text }} export default { data() { return { tableList: [ { id: 1, name: '张三', age: 20, hometown: '北京' }, { id: 2, name: '李四', age: 20, hometown: '上海' }, { id: 3, name: '王五', age: 23, hometown: '深圳' } ], tableColumns: [ { title: '序号', // 每一列对应的标题 dataIndex: 'id', // 每一列对应的数据源中的数据 width: 30, // 每一列的宽度 align: 'center' // 每一列的对齐方式,left/center/right }, { // title: '姓名', slots: { // 给每一列的表头(标题)进行处理 title: 'selfDefineTitle' }, dataIndex: 'name', width: 100 }, { title: '年龄', dataIndex: 'age', scopedSlots: { // 对表格中的该列数据进行处理 customRender: 'dealAge' }, width: 100 }, { title: '家庭住址', dataIndex: 'hometown', width: 100 } ], // rowClassName: (record, index) => { // let rowClassName = 'green' // if (index % 2 === 0) { // rowClassName = 'blue' // } // return rowClassName // } } }}.green { background: rgb(76, 196, 86);}.blue { background: rgb(34, 90, 211);} ��
上一篇:买服务器怎么备案?