Showing
5 changed files
with
65 additions
and
0 deletions
This diff could not be displayed because it is too large.
@@ -189,6 +189,12 @@ const routes = [{ | @@ -189,6 +189,12 @@ const routes = [{ | ||
189 | path: '/vue3/operationLog/userList', | 189 | path: '/vue3/operationLog/userList', |
190 | name: 'operationLogUserList', | 190 | name: 'operationLogUserList', |
191 | component: () => myImport('views/operationLog/userList') | 191 | component: () => myImport('views/operationLog/userList') |
192 | + }, | ||
193 | + //x6 | ||
194 | + { | ||
195 | + path: '/vue3/x6/index', | ||
196 | + name: 'operationLogUserList', | ||
197 | + component: () => myImport('views/x6/index') | ||
192 | } | 198 | } |
193 | ]; | 199 | ]; |
194 | 200 |
1 | +import('../../../public/lib/x6/x6.js'); | ||
2 | +export default { | ||
3 | + name: "x6Index", | ||
4 | + template: "", | ||
5 | + setup() { | ||
6 | + | ||
7 | + const init = () => { | ||
8 | + if (window.X6 == undefined) { | ||
9 | + setTimeout(function () { | ||
10 | + init(); | ||
11 | + }, 1000) | ||
12 | + return; | ||
13 | + } | ||
14 | + const {Graph} = window.X6 | ||
15 | + // 创建 Graph 的实例 | ||
16 | + const graph = new window.X6.Graph({ | ||
17 | + container: document.getElementById('container'), | ||
18 | + grid: true | ||
19 | + }) | ||
20 | + | ||
21 | + // 渲染源节点 | ||
22 | + const source = graph.addNode({ | ||
23 | + x: 300, | ||
24 | + y: 40, | ||
25 | + width: 80, | ||
26 | + height: 40, | ||
27 | + label: 'Hello', | ||
28 | + }) | ||
29 | + | ||
30 | + // 渲染目标节点 | ||
31 | + const target = graph.addNode({ | ||
32 | + x: 420, | ||
33 | + y: 180, | ||
34 | + width: 80, | ||
35 | + height: 40, | ||
36 | + label: 'World', | ||
37 | + }) | ||
38 | + | ||
39 | + // 渲染边 | ||
40 | + graph.addEdge({ | ||
41 | + source, | ||
42 | + target, | ||
43 | + }) | ||
44 | + } | ||
45 | + | ||
46 | + Vue.onMounted(() => { | ||
47 | + init(); | ||
48 | + }) | ||
49 | + } | ||
50 | +} |
@@ -290,6 +290,12 @@ const routes = [{ | @@ -290,6 +290,12 @@ const routes = [{ | ||
290 | path: '/vue3/operationLog/userList', | 290 | path: '/vue3/operationLog/userList', |
291 | name: 'operationLogUserList', | 291 | name: 'operationLogUserList', |
292 | component: () => myImport('views/operationLog/userList') | 292 | component: () => myImport('views/operationLog/userList') |
293 | + }, | ||
294 | + //x6 | ||
295 | + { | ||
296 | + path: '/vue3/x6/index', | ||
297 | + name: 'operationLogUserList', | ||
298 | + component: () => myImport('views/x6/index') | ||
293 | } | 299 | } |
294 | ]; | 300 | ]; |
295 | 301 |
-
Please register or login to post a comment