<template>
    <div>
        <LineLabel v-if="label" :label="label"></LineLabel>
        <div class="mt-20">
            <!-- <el-table :data="dataSource">
                <el-table-column v-for="(item) in columns" :prop="item.prop" :key="item.prop" :label="$t(item.label)"
                    class="no-break">
                </el-table-column>
            </el-table> -->
            <table class="datatable">
                <thead>
                    <tr>
                        <th v-for="(item) in columns" :key="item.prop" class="no-break">{{ $t(item.label) }}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(ditem, index) in dataSource" :key="index">
                        <td v-for="(item) in columns" :key="item.prop" class="no-break">
                            {{item.prop=='ndz'? (ditem['nd']+ditem['nddw']):ditem[item.prop] }}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</template>

<script>
import LineLabel from "./LineLabel.vue";

export default {
    components: {
        LineLabel,
    },
    props: {
        //[{label:"名称",prop:"name"}]
        columns: {
            type: Array,
            default: [],
        },
        dataSource: {
            type: Array,
            default: [],
        },
        label: {
            type: String,
            default: "",
        }
    }

}
</script>

<style lang="scss" scoped>
.mt-20 {
    margin-top: 20px;
}
</style>