File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
sites/docs/src/tutorial/basic/node/custom-view Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export default class Example extends React.Component {
31
31
lf . on ( 'node:click' , ( { data } : any ) => {
32
32
lf . setProperties ( data . id , {
33
33
// 改变业务属性
34
- clicked : ! data . properties . clicked ,
34
+ isClicked : ! data . properties . isClicked ,
35
35
scale : 0.8 , // 缩小
36
36
} ) ;
37
37
} ) ;
Original file line number Diff line number Diff line change @@ -57,20 +57,20 @@ class UserTaskModel extends RectNodeModel {
57
57
this . height = height * scale ;
58
58
}
59
59
60
- // 自定义文本样式:依赖业务属性 clicked 改变文本颜色
60
+ // 自定义文本样式:依赖业务属性 isClicked 改变文本颜色
61
61
getTextStyle ( ) {
62
62
const style = super . getTextStyle ( ) ;
63
63
style . fontSize = 12 ;
64
- const { clicked } = this . properties ;
65
- style . color = clicked ? 'red' : 'rgb(24, 125, 255)' ;
64
+ const { isClicked } = this . properties ;
65
+ style . color = isClicked ? 'red' : 'rgb(24, 125, 255)' ;
66
66
return style ;
67
67
}
68
68
69
- // 自定义节点样式:依赖业务属性 clicked 改变边框颜色
69
+ // 自定义节点样式:依赖业务属性 isClicked 改变边框颜色
70
70
getNodeStyle ( ) {
71
71
const style = super . getNodeStyle ( ) ;
72
- const { clicked } = this . properties ;
73
- if ( clicked ) {
72
+ const { isClicked } = this . properties ;
73
+ if ( isClicked ) {
74
74
style . stroke = 'red' ;
75
75
} else {
76
76
style . stroke = 'rgb(24, 125, 255)' ;
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const data = {
10
10
width : 100 ,
11
11
height : 100 ,
12
12
scale : 1 , // 自定义放大倍数
13
- clicked : false , // 自定义是否被点击
13
+ isClicked : false , // 自定义是否被点击
14
14
} ,
15
15
} ,
16
16
{
You can’t perform that action at this time.
0 commit comments