index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 / 100,
  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 'packages/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. </script>
  54. <style lang="scss" scoped>
  55. .bs-design-wrap {
  56. position: relative;
  57. display: flex;
  58. flex-direction: column;
  59. justify-content: center;
  60. align-items: center;
  61. width: 100%;
  62. height: 100%;
  63. background-color: transparent;
  64. border-radius: 4px;
  65. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  66. box-sizing: border-box;
  67. .custom-border-box {
  68. width: 100%;
  69. height: 100%;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. }
  74. }
  75. /*滚动条样式*/
  76. /deep/::-webkit-scrollbar {
  77. width: 4px;
  78. border-radius: 4px;
  79. height: 4px;
  80. }
  81. /deep/::-webkit-scrollbar-thumb {
  82. background: #dddddd !important;
  83. border-radius: 10px;
  84. }
  85. </style>