修复有时捐赠金额显示不出来的问题

This commit is contained in:
kron
2025-10-14 11:11:48 +08:00
parent eef113902e
commit 3b1fb5b270
2 changed files with 10 additions and 7 deletions

View File

@@ -1,11 +1,11 @@
<script setup>
import { ref, reactive, watch } from "vue";
import { donateAPI } from "@/apis";
import { ref, reactive, watch, onMounted } from "vue";
import { getAppConfig, donateAPI } from "@/apis";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
const { config } = storeToRefs(store);
const { updateConfig } = store;
const props = defineProps({
show: {
@@ -82,6 +82,13 @@ watch(
formData.suggestion = "";
}
);
onMounted(async () => {
if (!config.value.donateAmount) {
const config = await getAppConfig();
updateConfig(config);
}
});
</script>
<template>