add withChart prop to UserCardMini
This commit is contained in:
parent
98a831961e
commit
79af6df55e
|
@ -28,12 +28,18 @@ import MkMiniChart from "@/components/MkMiniChart.vue";
|
|||
import * as os from "@/os";
|
||||
import { acct } from "@/filters/user";
|
||||
|
||||
const props = defineProps<{
|
||||
const props = withDefaults(defineProps<{
|
||||
user: misskey.entities.User;
|
||||
}>();
|
||||
withChart?: boolean;
|
||||
}>(),
|
||||
{
|
||||
withChart: true,
|
||||
}
|
||||
);
|
||||
|
||||
let chartValues = $ref<number[] | null>(null);
|
||||
|
||||
if (props.withChart) {
|
||||
os.apiGet("charts/user/notes", {
|
||||
userId: props.user.id,
|
||||
limit: 16 + 1,
|
||||
|
@ -43,6 +49,7 @@ os.apiGet("charts/user/notes", {
|
|||
res.inc.splice(0, 1);
|
||||
chartValues = res.inc;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
|
Loading…
Reference in New Issue