index.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div
  3. style="width: 100%;height: 100%"
  4. class="bs-design-wrap"
  5. >
  6. <dv-border-box-2
  7. :id="'dataV' + config.code"
  8. :key="updateKey"
  9. >
  10. <div class="element" style="box-sizing: content-box;font-size:40px;color:#fff;height:50px;margin:0 0 0 20px">{{config.title}}</div>
  11. </dv-border-box-2>
  12. </div>
  13. </template>
  14. <script>
  15. import DvBorderBox2 from '@jiaminghi/data-view/lib/components/borderBox2/src/main.vue'
  16. import '@jiaminghi/data-view/lib/components/borderBox2/src/main.css'
  17. export default {
  18. name: 'Border2',
  19. components: {
  20. DvBorderBox2
  21. },
  22. props: {
  23. // 卡片的属性
  24. config: {
  25. type: Object,
  26. default: () => ({})
  27. }
  28. },
  29. data () {
  30. return {
  31. updateKey: 0
  32. }
  33. },
  34. computed: {
  35. Data () {
  36. return JSON.parse(JSON.stringify(this.config))
  37. }
  38. },
  39. watch: {
  40. Data: {
  41. handler (newVal, oldVal) {
  42. this.$nextTick(() => {
  43. if ((newVal.w !== oldVal.w) || (newVal.h !== oldVal.h)) {
  44. this.updateKey = new Date().getTime()
  45. }
  46. })
  47. },
  48. deep: true
  49. }
  50. },
  51. mounted () {},
  52. methods: {}
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .bs-design-wrap {
  57. position: absolute;
  58. width: 100%;
  59. height: 100%;
  60. // padding: 0 16px;
  61. background-color: transparent;
  62. border-radius: 4px;
  63. box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
  64. box-sizing: border-box;
  65. }
  66. /*滚动条样式*/
  67. ::v-deep ::-webkit-scrollbar {
  68. width: 4px;
  69. border-radius: 4px;
  70. height: 4px;
  71. }
  72. ::v-deep ::-webkit-scrollbar-thumb {
  73. background: #dddddd !important;
  74. border-radius: 10px;
  75. }
  76. </style>