ElemFillTable.vue 774 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div class="elem-fill-table">
  3. <table class="table">
  4. <tr v-for="rowNo in data.rowCount" :key="rowNo">
  5. <td v-for="colNo in data.colCount" :key="colNo" :style="tdStyles">
  6. <span> {{ data.content[`${rowNo}_${colNo}`] }}</span>
  7. </td>
  8. </tr>
  9. </table>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: "elem-fill-table",
  15. props: {
  16. data: {
  17. type: Object
  18. }
  19. },
  20. data() {
  21. return {};
  22. },
  23. computed: {
  24. tdStyles() {
  25. return {
  26. padding: this.data.padding.map(item => `${item}px`).join(" "),
  27. border: `1px ${this.data.lineStyle} #000`,
  28. fontSize: this.data.fontSize,
  29. height: this.data.lineHeight + "px"
  30. };
  31. }
  32. },
  33. mounted() {},
  34. methods: {}
  35. };
  36. </script>