3838 <label >deepCollapseChildren</label >
3939 <input v-model =" state.deepCollapseChildren" type =" checkbox" />
4040 </div >
41+ <div >
42+ <label >defaultCollapsePath</label >
43+ <input v-model =" state.collapsePathPattern" type =" input" />
44+ </div >
4145 </div >
4246 </div >
4347 <div class =" block" >
4650 :data =" state.data"
4751 :deep =" state.deep"
4852 :deepCollapseChildren =" state.deepCollapseChildren"
53+ :collapsePath =" state.collapsePath"
4954 :show-double-quotes =" state.showDoubleQuotes"
5055 :show-length =" state.showLength"
5156 :show-line =" state.showLine"
@@ -75,6 +80,9 @@ const defaultData = {
7580 ' Traffic paradise: How to design streets for people and unmanned vehicles in the future?' ,
7681 source: ' Netease smart' ,
7782 link: ' http://netease.smart/traffic-paradise/1235' ,
83+ author: {
84+ names: [' Daniel' , ' Mike' , ' John' ],
85+ },
7886 },
7987 {
8088 news_id: 51182 ,
@@ -100,8 +108,10 @@ export default defineComponent({
100108 showDoubleQuotes: true ,
101109 collapsedOnClickBrackets: true ,
102110 useCustomLinkFormatter: false ,
103- deep: 3 ,
111+ deep: 4 ,
104112 deepCollapseChildren: false ,
113+ collapsePath: / members/ ,
114+ collapsePathPattern: ' members' ,
105115 });
106116
107117 const customLinkFormatter = (data , key , path , defaultFormatted ) => {
@@ -123,6 +133,17 @@ export default defineComponent({
123133 },
124134 );
125135
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+
126147 return {
127148 state,
128149 customLinkFormatter,
0 commit comments