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 3838 :language =" selected.language"
3939 :prev =" prev"
4040 :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 "
4343 />
4444 </section >
4545 </div >
4646</template >
4747
4848<script lang="ts">
49- import { defineComponent , onMounted , ref , watch } from ' vue'
49+ import { defineComponent , ref , watch } from ' vue'
5050
5151import template from ' ./template'
5252
@@ -112,13 +112,6 @@ export default defineComponent({
112112 immediate: true
113113 })
114114
115- onMounted (() => {
116- const script = document .createElement (' script' )
117- script .async = true
118- script .defer = true
119- document .body .appendChild (script )
120- })
121-
122115 return {
123116 modes ,
124117 mode ,
Original file line number Diff line number Diff line change 2828</template >
2929
3030<script lang="ts">
31- import {
32- computed ,
33- defineComponent ,
34- ref ,
35- toRaw
36- } from ' vue'
31+ import { computed , defineComponent , ref , toRaw } from ' vue'
3732import { useVirtualScroll , useRender } from ' ./hooks'
3833import Line from ' ./Line.vue'
3934
@@ -89,7 +84,7 @@ export default defineComponent({
8984 const { minHeight } = useVirtualScroll (props , viewer , scrollOptions , meta )
9085
9186 const setLineHeight = (index : number , height : number ) => {
92- if (meta .value [index ]) {
87+ if (meta .value [index ] && meta . value [ index ]. height !== height ) {
9388 meta .value [index ].height = height
9489 }
9590 }
Original file line number Diff line number Diff line change @@ -103,13 +103,13 @@ export default defineComponent({
103103 }
104104
105105 const rendered = () => {
106- if (! line .value ) return
106+ if (! line .value || props . meta . height === line . value . offsetHeight ) return
107107 emit (' setLineHeight' , props .meta .index , line .value .offsetHeight )
108108 }
109109
110110 if (props .scrollOptions ) {
111111 useResizeObserver (line , useThrottleFn (() => {
112- if (! line .value ) return
112+ if (! line .value || props . meta . height === line . value . offsetHeight ) return
113113 emit (' setLineHeight' , props .meta .index , line .value .offsetHeight )
114114 }, props .scrollOptions .delay ))
115115 }
You can’t perform that action at this time.
0 commit comments