diff --git a/package-lock.json b/package-lock.json index 2a75b637..f0890fa1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16752,9 +16752,9 @@ } }, "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", "dev": true, "license": "MIT", "engines": { diff --git a/src/renderer/components/base/VirtualizedList.vue b/src/renderer/components/base/VirtualizedList.vue index ee8b627d..964ecab0 100644 --- a/src/renderer/components/base/VirtualizedList.vue +++ b/src/renderer/components/base/VirtualizedList.vue @@ -270,9 +270,15 @@ export default { cachedList = Array(list.length) startIndex = -1 endIndex = -1 - void nextTick(() => { - updateView() - }) + if (cachedList.length) { + void nextTick(() => { + requestAnimationFrame(() => { + updateView() + }) + }) + } else { + views.value = [] + } } watch(() => props.itemHeight, () => { handleReset(props.list) @@ -289,7 +295,15 @@ export default { cachedList = Array(props.list.length) startIndex = -1 endIndex = -1 - updateView() + + if (props.list.length) { + void nextTick(() => { + requestAnimationFrame(() => { + console.log('updateView') + updateView() + }) + }) + } window.addEventListener('resize', handleResize) }) onBeforeUnmount(() => { diff --git a/src/renderer/views/Setting/components/PlayTimeoutModal.vue b/src/renderer/views/Setting/components/PlayTimeoutModal.vue index 7c89a25d..c221aa19 100644 --- a/src/renderer/views/Setting/components/PlayTimeoutModal.vue +++ b/src/renderer/views/Setting/components/PlayTimeoutModal.vue @@ -11,8 +11,8 @@ material-modal(:show="modelValue" teleport="#view" @close="handleCloseModal" @af div(:class="[$style.row, $style.tip, { [$style.show]: !!timeLabel }]") p {{ $t('play_timeout_tip', { time: timeLabel }) }} div(:class="$style.footer") - base-btn(:class="$style.footerBtn" @click="handleCancel") {{ $t(timeLabel ? 'play_timeout_stop' : 'play_timeout_close') }} - base-btn(:class="$style.footerBtn" @click="handleConfirm") {{ $t(timeLabel ? 'play_timeout_update' : 'play_timeout_confirm') }} + base-btn(:class="$style.footerBtn" @click="handleCancel") {{ $t(timeLabel ? 'play_timeout_stop' : 'play_timeout_close') }} + base-btn(:class="$style.footerBtn" @click="handleConfirm") {{ $t(timeLabel ? 'play_timeout_update' : 'play_timeout_confirm') }}