table.column.image.vue 634 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <el-table-column :prop="prop" :label="label">
  3. <template slot-scope="{row}">
  4. <k-image :src="row[prop]" :style="imageStyle" fit="contain" referrer-policy="no-referrer" />
  5. </template>
  6. </el-table-column>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {};
  12. },
  13. computed: {
  14. imageStyle() {
  15. return {
  16. width: `${this.width}px`,
  17. height: `${this.height}px`
  18. };
  19. }
  20. },
  21. props: {
  22. prop: {},
  23. label: {},
  24. width: {
  25. default: "40"
  26. },
  27. height: {
  28. default: "40"
  29. }
  30. },
  31. watch: {},
  32. methods: {},
  33. components: {},
  34. mounted() {}
  35. };
  36. </script>