<template>
<div class="tablebox">
<el-table :data="tableDataList" style="width: 100%" :height="height" border size="small" stripe highlight-current-row v-loading="loading" @selection-change="handleSelectionChange">
<el-table-column v-if="tableNum" label="序号" type="index" fixed align="center" width="60"> </el-table-column>
<el-table-column v-if="tableSelect" type="selection" width="55" align="center"> </el-table-column>
<template v-for="column in tableListcolumn">
<el-table-column :key="column.prop" :label="column.label" :prop="column.prop" resizable show-overflow-tooltip :width="column.width" :fixed="column.fixed"></el-table-column>
</template>
<el-table-column v-if="tableOperation" align="center" label="操作" fixed="right" min-width="200">
<template slot-scope="scope">
<template v-for="item in rightButton">
<el-button v-if="item.type == scope.row.type" :key="item.id" type="text" size="mini" @click="handleClickMore(scope.row, item)"> {{ item.name }}</el-button>
</template>
<slot :name="btn" :row="scope.row"> </slot>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
name: 'TableSelect',
data () {
return {
btn:'btn'
}
},
props: ['tableListcolumn','tableDataList','tableOperation','tableSelect','tableNum', 'loading', 'rightButton', 'handleClickMore','height'],
methods: {
handleSelectionChange (val) {
this.$emit('handleSelectionChange', val)
},
}
}
</script>
后台表格组件
最新推荐文章于 2023-06-27 15:01:59 发布