surprise
2024-03-05 1ce1b525e7470ebaaeb0d5cd1e59bd905c1a7114
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<template>
<!-- 连线按钮组 -->
<ul
      class="el-dropdown-menu el-popper linkmenubar"
      id="link_menubar2"
      :style="linuMenuStyle"
      @mouseleave="linkMenuBarLeave"
      v-show="linkMenuShow"
    >
      <li class="el-dropdown-menu__item" @click="updateLinkName">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-editor"></use>
        </svg>
        <span class="pl-15">编辑</span>
      </li>
      <li class="el-dropdown-menu__item" @click="deleteLink">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-shanchu"></use>
        </svg>
        <span class="pl-15">删除</span>
      </li>
    </ul>
</template>
 
<script>
// import * as d3 from "d3";
 
export default {
  props: {
 
  },
  data() {
    return {
      top: '0px',
      left: '0px',
      linkMenuShow: false
    };
  },
  computed: {
    linuMenuStyle() {
      return {
        position:'absolute',
        top: this.top+ "px",
        left: this.left+ "px"
      };
    },
  },
  components: {
 
  },
  methods: {
    init(data) {
      //debugger
      this.top=data.top;
      this.left=data.left;
      this.linkMenuShow=data.show;
 
    },
    updateLinkName(){
      this.$emit("updateLinkName");
    },
    deleteLink(){
      this.$emit("deleteLink");
    },
    linkMenuBarLeave() {
      //d3.select(this).style("display", "none");
      this.linkMenuShow=false;
    },
  }
};
</script>
<style>
 
</style>