index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div
  3. style="width: 100%; height: 100%"
  4. class="bs-design-wrap"
  5. >
  6. <div
  7. :key="updateKey"
  8. class="custom-border-box"
  9. :style="{
  10. height: lineHeight + 'px',
  11. opacity: opacity,
  12. 'background-image': `linear-gradient(to right, ${
  13. gradientColor0 ? gradientColor0 : gradientColor1
  14. } , ${gradientColor1 ? gradientColor1 : gradientColor0})`
  15. }"
  16. />
  17. </div>
  18. </template>
  19. <script>
  20. import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
  21. export default {
  22. name: 'HorizontalLine',
  23. components: {},
  24. mixins: [refreshComponentMixin],
  25. props: {
  26. // 卡片的属性
  27. config: {
  28. type: Object,
  29. default: () => ({})
  30. }
  31. },
  32. data () {
  33. return {}
  34. },
  35. computed: {
  36. lineHeight () {
  37. return this.config.customize.height || 40
  38. },
  39. gradientColor0 () {
  40. return this.config.customize.gradientColor0 || ''
  41. },
  42. gradientColor1 () {
  43. return this.config.customize.gradientColor1 || ''
  44. },
  45. opacity () {
  46. return this.config.customize.opacity || 100
  47. }
  48. },
  49. watch: {},
  50. mounted () {},
  51. methods: {
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .bs-design-wrap {
  57. position: relative;
  58. display: flex;
  59. padding: 0 16px;
  60. flex-direction: column;
  61. justify-content: center;
  62. align-items: center;
  63. width: 100%;
  64. height: 100%;
  65. background-color: transparent;
  66. border-radius: 4px;
  67. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  68. box-sizing: border-box;
  69. .custom-border-box {
  70. width: 100%;
  71. height: 100%;
  72. display: flex;
  73. justify-content: center;
  74. align-items: center;
  75. }
  76. }
  77. /*滚动条样式*/
  78. ::v-deep ::-webkit-scrollbar {
  79. width: 4px;
  80. border-radius: 4px;
  81. height: 4px;
  82. }
  83. ::v-deep ::-webkit-scrollbar-thumb {
  84. background: #dddddd !important;
  85. border-radius: 10px;
  86. }
  87. </style>