tableCommon.vue 1.31 KB
<template>
  <!--
        调用: {
            tableData,  // 表格内容数据 array object
            headData,   // 表格表头数据 array object
            tabHeight,  // 是否固定头部 string: no | number: yes
        }
  -->
  <el-table
    class="asis-table"
    :data="tableData"
    :show-summary="isSummary"
    :summary-method="summaryCallback"
    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>
// import func from "../../../vue-temp/vue-editor-bridge";
export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    headData: {
      type: Array,
      default: () => []
    },
    tabHeight: {
      type: [Number, String],
      default: ""
    },
    isSummary: {
      type: Boolean,
      default: false
    },
    summaryCallback: {
      type: Function,
      default: () => null
    }
  },
  data() {
    return {
      //
    };
  },
  methods: {
    i18nFomatter(title) {
      let langeuageTitle = "echartsTitle." + title;
      return this.$t(langeuageTitle);
    }
  }
};
</script>