修复排位积分值不显示的问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import { ref, computed, watch } from "vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
@@ -29,16 +29,24 @@ const toUserPage = () => {
|
||||
});
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
const rankInfos = config.value.randInfos || [];
|
||||
rankInfos.some((r, index) => {
|
||||
if (r.upgrade_scores > user.value.scores) {
|
||||
nextLvlPoints.value = r.upgrade_scores;
|
||||
return true;
|
||||
watch(
|
||||
() => [config.value, user.value],
|
||||
([n_config, n_user]) => {
|
||||
const rankInfos = n_config.randInfos || [];
|
||||
if (n_user.id && rankInfos.length) {
|
||||
rankInfos.some((r, index) => {
|
||||
if (r.upgrade_scores > n_user.scores) {
|
||||
nextLvlPoints.value = r.upgrade_scores;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user