guide.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <!-- 辅助线 -->
  3. <view v-show="!isSortType">
  4. <view class="lines" :style="[lineWrapStyle]">
  5. <view class="item" :style="[lineStyle]"></view>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'guide',
  12. props: {
  13. dataConfig: {
  14. type: Object,
  15. default: () => {}
  16. },
  17. isSortType: {
  18. type: String | Number,
  19. default: 0
  20. }
  21. },
  22. data() {
  23. return {
  24. heightConfig: 0,
  25. lineColor: '',
  26. // lineStyle: 0,
  27. lrEdge: 0,
  28. mbConfig: 0
  29. };
  30. },
  31. computed: {
  32. lineWrapStyle() {
  33. return {
  34. padding: `${this.dataConfig.topConfig.val * 2}rpx ${this.dataConfig.lrEdge.val * 2}rpx ${this.dataConfig.bottomConfig.val * 2}rpx`,
  35. 'margin-top': `${this.dataConfig.mbConfig.val * 2}rpx`,
  36. 'background-color': this.dataConfig.lineBgColor.color[0].item
  37. };
  38. },
  39. lineStyle() {
  40. let borderStyle = '';
  41. switch (this.dataConfig.lineStyle.tabVal) {
  42. case 1:
  43. borderStyle = 'solid';
  44. break;
  45. case 2:
  46. borderStyle = 'dotted';
  47. break;
  48. default:
  49. borderStyle = 'dashed';
  50. break;
  51. }
  52. return {
  53. 'border-style': borderStyle,
  54. 'border-color': this.dataConfig.lineColor.color[0].item,
  55. };
  56. },
  57. },
  58. created() {},
  59. methods: {
  60. }
  61. }
  62. </script>
  63. <style lang="scss">
  64. .lines {
  65. padding: 0 20rpx;
  66. margin-top: 20rpx;
  67. .item {
  68. box-sizing: border-box;
  69. border-bottom-color: red;
  70. border-width: 0 0 1rpx;
  71. border-bottom-style: solid;
  72. }
  73. }
  74. </style>