File tree Expand file tree Collapse file tree 5 files changed +26
-1
lines changed Expand file tree Collapse file tree 5 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -119,4 +119,13 @@ button {
119
119
background : blue !important ;
120
120
}
121
121
122
+ .red-background {
123
+ background : black !important ;
124
+ color : white ;
125
+ }
126
+
127
+ .bold-font {
128
+ font-weight : bold !important ;
129
+ }
130
+
122
131
</style >
Original file line number Diff line number Diff line change 2
2
{
3
3
"name" : " Rejection Emails" ,
4
4
"type" : " emails" ,
5
+ "styles" : [" red-background" , " bold-font" ],
5
6
"expanded" : true ,
6
7
"children" : [
7
8
{
Original file line number Diff line number Diff line change @@ -51,6 +51,19 @@ export default defineComponent({
51
51
}
52
52
} ) ;
53
53
54
+ const styles = computed ( ( ) => {
55
+
56
+ var style : Record < string , boolean | undefined > = {
57
+ 'selected-tree-item' : ! props . isCheckable && props . item . selected
58
+ }
59
+
60
+ if ( props . item . styles ) {
61
+ props . item . styles . forEach ( s => style [ s ] = true )
62
+ }
63
+
64
+ return style ;
65
+ } ) ;
66
+
54
67
const updateCheckState = ( ) => {
55
68
if ( checkbox . value ) {
56
69
props . item . checked = checkbox . value . checked ;
@@ -122,6 +135,7 @@ export default defineComponent({
122
135
}
123
136
124
137
return {
138
+ styles,
125
139
checkbox,
126
140
parent,
127
141
treeState,
Original file line number Diff line number Diff line change 8
8
</slot >
9
9
</div >
10
10
11
- <div class =" pointer tree-item" :class =" { 'selected-tree-item': !isCheckable && item.selected } " style =" width : 100% " >
11
+ <div class =" pointer tree-item" :class =" styles " style =" width : 100% " >
12
12
<div v-if =" !isRenaming" @dblclick =" beginRenaming" >
13
13
<div v-if =" isCheckable" class =" tree-item__checkbox-area" >
14
14
<input @contextmenu.prevent @change =" updateCheckState" type =" checkbox" ref =" checkbox" :disabled =" item.disabled" :class =" checkboxStyle" />
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export interface TreeViewItem {
7
7
expanded ?: boolean ;
8
8
disabled ?: boolean ;
9
9
disableDragAndDrop ?: boolean ;
10
+ styles ?: string [ ] ;
10
11
meta ?: any ;
11
12
}
12
13
You can’t perform that action at this time.
0 commit comments