DividerComponents.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <script>
  2. export default {
  3. name: "DividerComponents",
  4. props: {
  5. index: {
  6. type: Number,
  7. default: -1
  8. }
  9. },
  10. computed: {
  11. configInfo: {
  12. get() {
  13. return this.$store.state.template.templateJson.components[this.index]
  14. },
  15. },
  16. configList: {
  17. get() {
  18. return this.$store.state.template.templateJson.components[this.index]
  19. && this.$store.state.template.templateJson.components[this.index].config
  20. },
  21. },
  22. borderStyle() {
  23. //获取线段大小
  24. const size = this.configList[0].value >= 1 && this.configList[0].value <= 5 ? this.configList[0].value : 1;
  25. // 获取线段类型
  26. const typeValue = this.configList && this.configList[1].value
  27. return `${size}px ${typeValue} #ebeef5`
  28. }
  29. }
  30. }
  31. </script>
  32. <template>
  33. <view
  34. class="divider-style"
  35. >
  36. <view
  37. :style="{
  38. margin: '10px 0',
  39. borderBottom: borderStyle
  40. }"
  41. >
  42. </view>
  43. </view>
  44. </template>
  45. <style scoped lang="scss">
  46. .divider-style {
  47. height: 100%;
  48. display: flex;
  49. justify-content: center;
  50. align-items: center;
  51. //border: 1px solid #ebeef5;
  52. padding:5px;
  53. margin: 10px 0;
  54. div {
  55. width: 100%;
  56. }
  57. }
  58. </style>