index.vue 2.5 KB

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