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 +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
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 =" selected.inputDelay "
42- :virtual-scroll =" selected.virtualScroll "
41+ :input-delay =" 0 "
42+ :virtual-scroll =" { height: 500, lineMinHeight: 24, delay: 100 } "
4343 />
4444 </section >
4545 </div >
4646</template >
4747
4848<script lang="ts">
49- import { defineComponent , ref , watch } from ' vue'
49+ import { defineComponent , onMounted , ref , watch } from ' vue'
5050
5151import template from ' ./template'
5252
@@ -112,6 +112,13 @@ 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+
115122 return {
116123 modes ,
117124 mode ,
Original file line number Diff line number Diff line change 2828</template >
2929
3030<script lang="ts">
31- import { computed , defineComponent , ref , toRaw } from ' vue'
31+ import {
32+ computed ,
33+ defineComponent ,
34+ ref ,
35+ toRaw
36+ } from ' vue'
3237import { useVirtualScroll , useRender } from ' ./hooks'
3338import Line from ' ./Line.vue'
3439
@@ -84,7 +89,7 @@ export default defineComponent({
8489 const { minHeight } = useVirtualScroll (props , viewer , scrollOptions , meta )
8590
8691 const setLineHeight = (index : number , height : number ) => {
87- if (meta .value [index ] && meta . value [ index ]. height !== height ) {
92+ if (meta .value [index ]) {
8893 meta .value [index ].height = height
8994 }
9095 }
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 || props . meta . height === line . value . offsetHeight ) return
106+ if (! line .value ) return
107107 emit (' setLineHeight' , props .meta .index , line .value .offsetHeight )
108108 }
109109
110110 if (props .scrollOptions ) {
111111 useResizeObserver (line , useThrottleFn (() => {
112- if (! line .value || props . meta . height === line . value . offsetHeight ) return
112+ if (! line .value ) 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