table.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <el-table
  3. :data="tableData"
  4. :span-method="objectSpanMethod"
  5. :header-cell-style="{ background: '#e1e4e5',color: '#2b2b2b', lineHeight: '30px' }"
  6. class="table"
  7. style="width: 100%;"
  8. height="100%"
  9. >
  10. <el-table-column
  11. v-for="(item,index) in tableHeader"
  12. :key="index"
  13. prop="cCADID"
  14. :label="item"
  15. align="left"
  16. >
  17. </el-table-column>
  18. <el-table-column
  19. label="操作"
  20. align="left"
  21. >
  22. <template slot-scope="scope">
  23. <el-button slot="reference" size="mini" icon="el-icon-delete"
  24. @click="deleteObject(scope.$index, scope.row)"/>
  25. </template>
  26. </el-table-column>
  27. </el-table>
  28. </template>
  29. <script lang="ts">
  30. import { Component, Prop, Vue } from "vue-property-decorator";
  31. @Component({
  32. name: 'relation-table'
  33. })
  34. export default class extends Vue {
  35. @Prop({default:Array}) tableHeader?:[]
  36. @Prop({default:Array}) tableData?:[]
  37. objectSpanMethod() {
  38. }
  39. deleteObject() {
  40. }
  41. }
  42. </script>
  43. <style scoped>
  44. </style>