index.vue 2.4 KB

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