Skip to content

Commit 3ee5972

Browse files
committed
Remove Autoheight
1 parent 6aed6fe commit 3ee5972

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

example/VirtualList.vue

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
<label>virtualLines</label>
1111
<input v-model="state.virtualLines" type="number" />
1212
</div>
13-
<div>
14-
<label>autoHeight</label>
15-
<input v-model="state.autoHeight" type="checkbox" />
16-
</div>
17-
<div>
13+
<div>
1814
<label>showLine</label>
1915
<input v-model="state.showLine" type="checkbox" />
2016
</div>
@@ -35,9 +31,9 @@
3531
<div class="block">
3632
<h3>vue-json-pretty(1000+ items):</h3>
3733
<vue-json-pretty
34+
style="height:400px"
3835
:virtual="true"
3936
:virtualLines="state.virtualLines"
40-
:autoHeight="state.autoHeight"
4137
:data="state.data"
4238
:deep="state.deep"
4339
:show-line="state.showLine"
@@ -73,9 +69,8 @@ export default defineComponent({
7369
showLine: true,
7470
collapsedOnClickBrackets: true,
7571
deep: 3,
76-
virtualLines: 15,
77-
autoHeight: true
78-
});
72+
virtualLines: 20,
73+
});
7974
8075
watch(
8176
() => state.val,

src/components/Tree/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ export default defineComponent({
4040
type: Number,
4141
default: 20,
4242
},
43-
//Calculate the container height based on number of items
44-
autoHeight: {
45-
type: Boolean,
46-
default: true
47-
},
4843
// When there is a selection function, define the selected path.
4944
// For multiple selections, it is an array ['root.a','root.b'], for single selection, it is a string of 'root.a'.
5045
modelValue: {
@@ -213,7 +208,6 @@ export default defineComponent({
213208
virtual,
214209
itemHeight,
215210
virtualLines,
216-
autoHeight,
217211
customValueFormatter,
218212
showDoubleQuotes,
219213
showLength,
@@ -258,8 +252,7 @@ export default defineComponent({
258252
return (
259253
<div
260254
ref="tree"
261-
style={{height: autoHeight ? `${itemHeight * virtualLines}px` : 'initial'}}
262-
class={{
255+
class={{
263256
'vjs-tree': true,
264257
'is-virtual': virtual,
265258
}}

0 commit comments

Comments
 (0)