This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-01-19 15:01:13 +07:00
parent 8b26530d52
commit 112e6911ad
3 changed files with 50 additions and 34 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ref, computed, nextTick } from 'vue'
import { useQuasar } from 'quasar'
import http from '@/plugins/http'
import config from '@/app.config'
@ -53,6 +53,7 @@ const privacyContent = {
},
}
const scrollContainer = ref<HTMLElement | null>(null)
const hasScrolledToBottom = ref(false)
const acceptPrivacy = ref(false)
const showDetails = ref(false)
@ -60,6 +61,7 @@ const isAcceptDisabled = computed(() => !acceptPrivacy.value)
const handleScroll = (event: Event) => {
const target = event.target as HTMLElement
if (!target) return
const { scrollTop, scrollHeight, clientHeight } = target
@ -82,6 +84,20 @@ const handleAccept = async () => {
const toggleDetails = () => {
showDetails.value = !showDetails.value
checkIfScrollable()
}
const checkIfScrollable = () => {
nextTick(() => {
const container = scrollContainer.value?.$el || scrollContainer.value
if (container) {
const { scrollHeight, clientHeight } = container
if (scrollHeight <= clientHeight + 20) {
hasScrolledToBottom.value = true
}
}
})
}
</script>