Skip to content

Commit

Permalink
hua aide-pro(add donate dialog)
Browse files Browse the repository at this point in the history
  • Loading branch information
yichen9247 committed Aug 19, 2024
1 parent 4471847 commit 44d7dc2
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions src/frame/FriendsFrame.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@

<script setup>
import utils from '@/scripts/utils'
import { ref, onMounted, watch } from 'vue'
import { useInViewport } from 'vue-hooks-plus'
import { ref, onMounted } from 'vue'
const domRef = ref(null);
const siteConfig = ref(null);
const readyStatus = ref(false);
const applicationStore = utils.useApplicationStore();
onMounted(async () => {
let requestNum = 1;
const [inViewport] = useInViewport(domRef);
watch(inViewport,async () => {
if (requestNum == 0) {
if (!applicationStore.isLoadingStatus && inViewport) {
await utils.axiostool.sendHttpGet(utils.apiConfig.friends).then((data) => {
siteConfig.value = data;
readyStatus.value = true;
}).catch(async (error) => {
throw new Error(error);
});
}
}
requestNum--;
await utils.axiostool.sendHttpGet(utils.apiConfig.friends).then((data) => {
siteConfig.value = data;
readyStatus.value = true;
}).catch(async (error) => {
throw new Error(error);
});
});
</script>

<template>
<div class="friends-frame" :class="applicationStore.isDeviceMobile && 'frame-mobile'" ref="domRef">
<div class="friends-frame" :class="applicationStore.isDeviceMobile && 'frame-mobile'">
<div class="friends-box">
<h1 class="frame-title">友情链接</h1>
<p class="frame-desc">无需因陌生而胆怯,我眼里都是灰烬~</p>
Expand Down

0 comments on commit 44d7dc2

Please sign in to comment.