fix
This commit is contained in:
parent
8b26530d52
commit
112e6911ad
3 changed files with 50 additions and 34 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue