This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change 38
38
:language =" selected.language"
39
39
:prev =" prev"
40
40
:current =" current"
41
- :input-delay =" 0 "
42
- :virtual-scroll =" { height: 500, lineMinHeight: 24, delay: 100 } "
41
+ :input-delay =" selected.inputDelay "
42
+ :virtual-scroll =" selected.virtualScroll "
43
43
/>
44
44
</section >
45
45
</div >
46
46
</template >
47
47
48
48
<script lang="ts">
49
- import { defineComponent , onMounted , ref , watch } from ' vue'
49
+ import { defineComponent , ref , watch } from ' vue'
50
50
51
51
import template from ' ./template'
52
52
@@ -112,13 +112,6 @@ export default defineComponent({
112
112
immediate: true
113
113
})
114
114
115
- onMounted (() => {
116
- const script = document .createElement (' script' )
117
- script .async = true
118
- script .defer = true
119
- document .body .appendChild (script )
120
- })
121
-
122
115
return {
123
116
modes ,
124
117
mode ,
Original file line number Diff line number Diff line change 28
28
</template >
29
29
30
30
<script lang="ts">
31
- import {
32
- computed ,
33
- defineComponent ,
34
- ref ,
35
- toRaw
36
- } from ' vue'
31
+ import { computed , defineComponent , ref , toRaw } from ' vue'
37
32
import { useVirtualScroll , useRender } from ' ./hooks'
38
33
import Line from ' ./Line.vue'
39
34
@@ -89,7 +84,7 @@ export default defineComponent({
89
84
const { minHeight } = useVirtualScroll (props , viewer , scrollOptions , meta )
90
85
91
86
const setLineHeight = (index : number , height : number ) => {
92
- if (meta .value [index ]) {
87
+ if (meta .value [index ] && meta . value [ index ]. height !== height ) {
93
88
meta .value [index ].height = height
94
89
}
95
90
}
Original file line number Diff line number Diff line change @@ -103,13 +103,13 @@ export default defineComponent({
103
103
}
104
104
105
105
const rendered = () => {
106
- if (! line .value ) return
106
+ if (! line .value || props . meta . height === line . value . offsetHeight ) return
107
107
emit (' setLineHeight' , props .meta .index , line .value .offsetHeight )
108
108
}
109
109
110
110
if (props .scrollOptions ) {
111
111
useResizeObserver (line , useThrottleFn (() => {
112
- if (! line .value ) return
112
+ if (! line .value || props . meta . height === line . value . offsetHeight ) return
113
113
emit (' setLineHeight' , props .meta .index , line .value .offsetHeight )
114
114
}, props .scrollOptions .delay ))
115
115
}
You can’t perform that action at this time.
0 commit comments