parent
4f5766117d
commit
e40c5352a1
4 changed files with 45 additions and 105 deletions
31
src/components/table/table-tr.vue
Normal file
31
src/components/table/table-tr.vue
Normal file
|
@ -0,0 +1,31 @@
|
|||
<template>
|
||||
<tr :class="rowClasses(row._index)"><slot></slot></tr>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
row: Object,
|
||||
prefixCls: String
|
||||
},
|
||||
computed: {
|
||||
objData () {
|
||||
return this.$parent.objData;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rowClasses (_index) {
|
||||
return [
|
||||
`${this.prefixCls}-row`,
|
||||
this.rowClsName(_index),
|
||||
{
|
||||
[`${this.prefixCls}-row-highlight`]: this.objData[_index] && this.objData[_index]._isHighlight,
|
||||
[`${this.prefixCls}-row-hover`]: this.objData[_index] && this.objData[_index]._isHover
|
||||
}
|
||||
];
|
||||
},
|
||||
rowClsName (_index) {
|
||||
return this.$parent.$parent.rowClassName(this.objData[_index], _index);
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue