index.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 'packages/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. // 由于静态组件没有混入公共函数,所以需要定义一个changeStyle方法,以免报错
  53. changeStyle () {
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .bs-design-wrap {
  60. position: relative;
  61. width: 100%;
  62. height: 100%;
  63. display: flex;
  64. flex-direction: column;
  65. justify-content: center;
  66. align-items: center;
  67. background-color: transparent;
  68. border-radius: 4px;
  69. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  70. box-sizing: border-box;
  71. .custom-border-box {
  72. width: 100%;
  73. height: 100%;
  74. // border: 1px solid rgba(131, 191, 246, 0);
  75. // background-color: #007aff;
  76. display: flex;
  77. justify-content: center;
  78. align-items: center;
  79. }
  80. }
  81. /*滚动条样式*/
  82. /deep/::-webkit-scrollbar {
  83. width: 4px;
  84. border-radius: 4px;
  85. height: 4px;
  86. }
  87. /deep/::-webkit-scrollbar-thumb {
  88. background: #dddddd !important;
  89. border-radius: 10px;
  90. }
  91. </style>