<template>
    <div>
        <el-table :data="tableData">
            <!-- 根据选择不同更换表格 -->
            <el-table-column v-for="item in columns" 
            :key="item.prop" 
            :prop="item.prop" 
            align="center"
            :label="item.label" >
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
                <template slot-scope="scope">
                  <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-edit"
                    @click="handleUpdate(scope.row)"
                    v-hasPermi="['manage:softwareConfig:edit']"
                  >修改</el-button>
                  <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-delete"
                    @click="handleDelete(scope.row)"
                    v-hasPermi="['manage:softwareConfig:remove']"
                  >删除</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        props: {
            tableData: {
                type: Array,
                default: () => []
            },
            columns: {
                type: Array,
                default: () => []
            },
        },
        created() {
        },
        methods: {
            handleUpdate(row) {
                this.$emit('handleUpdate', row)
            },
            handleDelete(row){
                this.$emit('handleDelete', row)
            }
        },
        
    }
</script>

<style lang="sass" scoped>

</style>