38
38
<label >deepCollapseChildren</label >
39
39
<input v-model =" state.deepCollapseChildren" type =" checkbox" />
40
40
</div >
41
+ <div >
42
+ <label >defaultCollapsePath</label >
43
+ <input v-model =" state.collapsePathPattern" type =" input" />
44
+ </div >
41
45
</div >
42
46
</div >
43
47
<div class =" block" >
46
50
:data =" state.data"
47
51
:deep =" state.deep"
48
52
:deepCollapseChildren =" state.deepCollapseChildren"
53
+ :collapsePath =" state.collapsePath"
49
54
:show-double-quotes =" state.showDoubleQuotes"
50
55
:show-length =" state.showLength"
51
56
:show-line =" state.showLine"
@@ -75,6 +80,9 @@ const defaultData = {
75
80
' Traffic paradise: How to design streets for people and unmanned vehicles in the future?' ,
76
81
source: ' Netease smart' ,
77
82
link: ' http://netease.smart/traffic-paradise/1235' ,
83
+ author: {
84
+ names: [' Daniel' , ' Mike' , ' John' ],
85
+ },
78
86
},
79
87
{
80
88
news_id: 51182 ,
@@ -100,8 +108,10 @@ export default defineComponent({
100
108
showDoubleQuotes: true ,
101
109
collapsedOnClickBrackets: true ,
102
110
useCustomLinkFormatter: false ,
103
- deep: 3 ,
111
+ deep: 4 ,
104
112
deepCollapseChildren: false ,
113
+ collapsePath: / members/ ,
114
+ collapsePathPattern: ' members' ,
105
115
});
106
116
107
117
const customLinkFormatter = (data , key , path , defaultFormatted ) => {
@@ -123,6 +133,17 @@ export default defineComponent({
123
133
},
124
134
);
125
135
136
+ watch (
137
+ () => state .collapsePath ,
138
+ newVal => {
139
+ try {
140
+ state .collapsePath = new RegExp (newVal);
141
+ } catch (err) {
142
+ // console.log('Regexp ERROR');
143
+ }
144
+ },
145
+ );
146
+
126
147
return {
127
148
state,
128
149
customLinkFormatter,
0 commit comments