Skip to content

Commit 041e525

Browse files
authored
Merge pull request #167 from leezng/dev
release 2.0.7
2 parents 7af5ab2 + 1af362f commit 041e525

File tree

6 files changed

+3549
-5144
lines changed

6 files changed

+3549
-5144
lines changed

example/Basic.vue

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
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">
@@ -46,6 +50,7 @@
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,

example/SelectControl.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ export default defineComponent({
192192
},
193193
);
194194
195+
watch(
196+
() => state.useCustomLinkFormatter,
197+
async () => {
198+
state.renderOK = false;
199+
await nextTick();
200+
state.renderOK = true;
201+
},
202+
);
203+
195204
return {
196205
state,
197206
customLinkFormatter,

0 commit comments

Comments
 (0)