index.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. 'border-top-left-radius': radiusLeftTop + 'px',
  11. 'border-top-right-radius': radiusRightTop + 'px',
  12. 'border-bottom-left-radius': radiusLeftBottom + 'px',
  13. 'border-bottom-right-radius': radiusRightBottom + 'px',
  14. border: `${width}px solid ${color} `,
  15. opacity: opacity / 100,
  16. 'background-image': `linear-gradient(${gradientDirection}, ${
  17. gradientColor0 ? gradientColor0 : gradientColor1
  18. } , ${gradientColor1 ? gradientColor1 : gradientColor0})`
  19. }"
  20. />
  21. </div>
  22. </template>
  23. <script>
  24. import { refreshComponentMixin } from 'data-room-ui/js/mixins/refreshComponent'
  25. export default {
  26. name: 'Border14',
  27. components: {},
  28. mixins: [refreshComponentMixin],
  29. props: {
  30. // 卡片的属性
  31. config: {
  32. type: Object,
  33. default: () => ({})
  34. }
  35. },
  36. data () {
  37. return {}
  38. },
  39. computed: {
  40. color () {
  41. return this.config.customize.borderColor || ''
  42. },
  43. width () {
  44. return this.config.customize.borderWidth || 0
  45. },
  46. gradientColor0 () {
  47. return this.config.customize.gradientColor0 || ''
  48. },
  49. gradientColor1 () {
  50. return this.config.customize.gradientColor1 || ''
  51. },
  52. radiusLeftTop () {
  53. return this.config.customize.radiusLeftTop || 0
  54. },
  55. radiusRightTop () {
  56. return this.config.customize.radiusRightTop || 0
  57. },
  58. radiusLeftBottom () {
  59. return this.config.customize.radiusLeftBottom || 0
  60. },
  61. radiusRightBottom () {
  62. return this.config.customize.radiusRightBottom || 0
  63. },
  64. gradientDirection () {
  65. return this.config.customize.gradientDirection
  66. },
  67. opacity () {
  68. return this.config.customize.opacity || 100
  69. }
  70. },
  71. watch: {},
  72. mounted () {},
  73. methods: {}
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .bs-design-wrap {
  78. position: relative;
  79. width: 100%;
  80. height: 100%;
  81. background-color: transparent;
  82. border-radius: 4px;
  83. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  84. box-sizing: border-box;
  85. .custom-border-box {
  86. width: 100%;
  87. height: 100%;
  88. }
  89. }
  90. /*滚动条样式*/
  91. ::v-deep ::-webkit-scrollbar {
  92. width: 4px;
  93. border-radius: 4px;
  94. height: 4px;
  95. }
  96. ::v-deep ::-webkit-scrollbar-thumb {
  97. background: #dddddd !important;
  98. border-radius: 10px;
  99. }
  100. </style>