index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. width: width + 'px',
  11. opacity: opacity,
  12. 'background-image': `linear-gradient(to bottom, ${
  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: 'VerticalLine',
  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. width () {
  37. return this.config.customize.width || 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. width: 100%;
  59. height: 100%;
  60. display: flex;
  61. flex-direction: column;
  62. justify-content: center;
  63. align-items: center;
  64. background-color: transparent;
  65. border-radius: 4px;
  66. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  67. box-sizing: border-box;
  68. .custom-border-box {
  69. width: 100%;
  70. height: 100%;
  71. // border: 1px solid rgba(131, 191, 246, 0);
  72. // background-color: #007aff;
  73. display: flex;
  74. justify-content: center;
  75. align-items: center;
  76. }
  77. }
  78. /*滚动条样式*/
  79. ::v-deep ::-webkit-scrollbar {
  80. width: 4px;
  81. border-radius: 4px;
  82. height: 4px;
  83. }
  84. ::v-deep ::-webkit-scrollbar-thumb {
  85. background: #dddddd !important;
  86. border-radius: 10px;
  87. }
  88. </style>