File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ plugins: [
112
112
| showDoubleQuotes | normal | Whether to show doublequotes on key | boolean | true |
113
113
| virtual | normal | Whether to use virtual scrolling, usually used for big data | boolean | false |
114
114
| itemHeight | normal | The height of each item when using virtual scrolling | number | auto |
115
+ | virtualLines | normal | The number of lines to render when virtual scrolling is enabled | number | 10 |
115
116
| v-model | higher | Defines value when the tree can be selected | string, array | - |
116
117
| path | higher | Root data path | string | root |
117
118
| pathSelectable | higher | Defines whether a data path supports selection | function(path, content) | - |
Original file line number Diff line number Diff line change @@ -127,6 +127,11 @@ export default {
127
127
type: Function ,
128
128
default: null ,
129
129
},
130
+ // Number of lines to show when virtual is true
131
+ virtualLines: {
132
+ type: Number ,
133
+ default: 10
134
+ }
130
135
},
131
136
data () {
132
137
return {
@@ -217,7 +222,7 @@ export default {
217
222
methods: {
218
223
onTreeScroll () {
219
224
if (this .virtual ) {
220
- const visibleCount = 10 ;
225
+ const visibleCount = this . virtualLines ;
221
226
const scrollTop = (this .$refs .tree && this .$refs .tree .scrollTop ) || 0 ;
222
227
const scrollCount = Math .floor (scrollTop / this .itemHeight );
223
228
let start =
You can’t perform that action at this time.
0 commit comments