add withChart prop to UserCardMini
This commit is contained in:
parent
98a831961e
commit
79af6df55e
1 changed files with 19 additions and 12 deletions
|
@ -28,21 +28,28 @@ import MkMiniChart from "@/components/MkMiniChart.vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { acct } from "@/filters/user";
|
import { acct } from "@/filters/user";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
user: misskey.entities.User;
|
user: misskey.entities.User;
|
||||||
}>();
|
withChart?: boolean;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
withChart: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let chartValues = $ref<number[] | null>(null);
|
let chartValues = $ref<number[] | null>(null);
|
||||||
|
|
||||||
os.apiGet("charts/user/notes", {
|
if (props.withChart) {
|
||||||
userId: props.user.id,
|
os.apiGet("charts/user/notes", {
|
||||||
limit: 16 + 1,
|
userId: props.user.id,
|
||||||
span: "day",
|
limit: 16 + 1,
|
||||||
}).then((res) => {
|
span: "day",
|
||||||
// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
|
}).then((res) => {
|
||||||
res.inc.splice(0, 1);
|
// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
|
||||||
chartValues = res.inc;
|
res.inc.splice(0, 1);
|
||||||
});
|
chartValues = res.inc;
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
|
|
Loading…
Reference in a new issue