index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!-- 这里是拖入节点时的模拟元素 -->
  2. <template>
  3. <div class="nodesBus-contain" :style="{left: this.pos_x + 90 + 'px', top: this.pos_y + 30 + 'px' }">
  4. <div class="nodesBus">
  5. <span class="icon"></span>
  6. <span class="name">{{ value }}</span>
  7. </div>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'NodeBus',
  13. props: {
  14. value: {
  15. type: String,
  16. default: "传入内容"
  17. },
  18. pos_x: {
  19. type: Number
  20. },
  21. pos_y: {
  22. type: Number
  23. }
  24. },
  25. data() {
  26. return {
  27. name: this.value,
  28. left: this.pos_x,
  29. top: this.pos_y
  30. };
  31. }
  32. };
  33. </script>
  34. <style scoped>
  35. .nodesBus-contain {
  36. box-sizing: border-box;
  37. width: 10px;
  38. height: 10px;
  39. position: absolute;
  40. }
  41. .nodesBus {
  42. box-sizing: border-box;
  43. transform: translate(-180px, -45px);
  44. width: 180px;
  45. height: 30px;
  46. background-color: rgba(255, 255, 255, 0.9);
  47. border: 1px solid #289de9;
  48. border-radius: 15px;
  49. font-size: 12px;
  50. -webkit-transition: background-color 0.2s;
  51. transition: background-color 0.2s;
  52. position: absolute;
  53. pointer-events: none;
  54. }
  55. .nodesBus .icon {
  56. width: 26px;
  57. height: 26px;
  58. margin: 1px;
  59. border-radius: 100%;
  60. float: left;
  61. color: #fff;
  62. font-size: 16px;
  63. background-color: #289de9;
  64. cursor: pointer;
  65. }
  66. .nodesBus .name {
  67. float: left;
  68. margin-left: 2px;
  69. width: 135px;
  70. height: 28px;
  71. line-height: 28px;
  72. font-size: 14px;
  73. overflow: hidden;
  74. text-overflow: ellipsis;
  75. white-space: nowrap;
  76. cursor: pointer;
  77. user-select: none;
  78. }
  79. </style>