tableCommon.vue 1.1 KB
<template>
    <!--
        调用: {
            tableData,  // 表格内容数据 array object
            headData,   // 表格表头数据 array object
            tabHeight,  // 是否固定头部 string: no | number: yes
        }
      -->
    <el-table
        class="asis-table"
        :data="tableData"
        header-row-class-name="asis-table-head"
        :height="typeof tabHeight === 'number' ? tabHeight : null"
        style="width: 100%">
            <el-table-column :prop="item.prop" :label="item.label" align="center" v-for="item in headData" :key="item.prop">
            </el-table-column>
    </el-table>
</template>

<script>
export default {
    props: {
        tableData: {
            type: Array,
            default: []
        },
        headData: {
            type: Array,
            default: []
        },
        tabHeight: [Number, String]
    },
    data () {
        return {
            // 
        }
    },
    methods: {
        i18nFomatter(title){
            let langeuageTitle = 'echartsTitle.' + title;
            return this.$t(langeuageTitle)
        },
    }
}
</script>