Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
vue-gojs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴斌
vue-gojs
Commits
7c1c2433
Commit
7c1c2433
authored
Oct 10, 2023
by
吴斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:为新加连接线添加默认 category
parent
02c8c765
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
App.vue
src/App.vue
+13
-0
No files found.
src/App.vue
View file @
7c1c2433
...
@@ -269,6 +269,18 @@ function addInspector(){
...
@@ -269,6 +269,18 @@ function addInspector(){
addProperty
.
value
=
false
addProperty
.
value
=
false
}
}
function
addListener
(){
// 监听连线事件,为所有新添加的线默认加上 "Arrow" 类别
myDiagram
.
addDiagramListener
(
"LinkDrawn"
,
function
(
e
:
go
.
DiagramEvent
)
{
let
link
=
e
.
subject
;
let
linkDataArray
=
myDiagram
.
model
.
linkDataArray
linkDataArray
.
forEach
((
item
:
any
)
=>
{
if
(
item
===
link
.
data
&&
!
item
.
category
){
myDiagram
.
model
.
set
(
item
,
"category"
,
"Arrow"
)
}
})
});
}
function
importData
()
{
function
importData
()
{
myDiagram
.
model
=
go
.
Model
.
fromJson
(
myDiagram
.
model
=
go
.
Model
.
fromJson
(
{
"class"
:
"GraphLinksModel"
,
{
"class"
:
"GraphLinksModel"
,
...
@@ -353,6 +365,7 @@ onMounted(() => {
...
@@ -353,6 +365,7 @@ onMounted(() => {
importData
();
importData
();
changeData
();
changeData
();
animateFlow
(
myDiagram
);
animateFlow
(
myDiagram
);
addListener
();
})
})
</
script
>
</
script
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment