ElemLine.vue 875 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div :class="classes">
  3. <div class="line-body" :style="styles"></div>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: "elem-line-horizontal",
  9. props: {
  10. data: {
  11. type: Object
  12. }
  13. },
  14. computed: {
  15. classes() {
  16. return [
  17. "elem-line",
  18. this.data.type === "LINE_HORIZONTAL"
  19. ? "elem-line-horizontal"
  20. : "elem-line-vertical"
  21. ];
  22. },
  23. styles() {
  24. return this.data.type === "LINE_HORIZONTAL"
  25. ? {
  26. borderBottomStyle: this.data.style,
  27. borderBottomWidth: this.data.bold,
  28. borderBottomColor: this.data.color
  29. }
  30. : {
  31. borderLeftStyle: this.data.style,
  32. borderLeftWidth: this.data.bold,
  33. borderLeftColor: this.data.color
  34. };
  35. }
  36. },
  37. data() {
  38. return {};
  39. },
  40. methods: {}
  41. };
  42. </script>