提交 ac68abf7 编写于 作者: View Design's avatar View Design

图表

上级 bb58a87e
...@@ -10,6 +10,15 @@ ...@@ -10,6 +10,15 @@
<template v-if="item.data.length"> <template v-if="item.data.length">
<template v-for="(chart, cIndex) in item.data" :key="cIndex"> <template v-for="(chart, cIndex) in item.data" :key="cIndex">
<UCard :ui="cardUI"> <UCard :ui="cardUI">
<template v-if="chart.info">
<div class="flex mb-2">
<div class="flex items-center gap-1 text-sm overflow-hidden">
<UIcon class="flex-shrink-0" name="i-simple-icons-github" />
<ULink class="flex-grow truncate underline" :to="chart.info.url" target="_blank" :title="chart.info.description">{{ chart.info.name }}</ULink>
<UIcon class="flex-shrink-0" name="i-heroicons-arrow-top-right-on-square" />
</div>
</div>
</template>
<ProseChart <ProseChart
type="line" type="line"
:labels="chart.labels" :labels="chart.labels"
...@@ -17,6 +26,7 @@ ...@@ -17,6 +26,7 @@
:info="chart.info" :info="chart.info"
simple simple
/> />
<div class="text-sm text-center text-gray-500 dark:text-gray-400 mt-2">{{ item.title }}</div>
</UCard> </UCard>
</template> </template>
</template> </template>
......
<template> <template>
<template v-if="info">
<div class="mt-2 flex flex-col gap-1">
<div class="flex items-center gap-1 text-sm">
<UIcon class="flex-shrink-0" name="i-simple-icons-github" />
<ULink class="line-clamp-1 underline" :to="info.url" target="_blank" :title="info.description">{{ info.name }}</ULink>
<UIcon class="flex-shrink-0" name="i-heroicons-arrow-top-right-on-square" />
</div>
</div>
</template>
<div class="w-full relative" style="aspect-ratio: 2/1"> <div class="w-full relative" style="aspect-ratio: 2/1">
<canvas ref="refChart" :aria-label="title"></canvas> <canvas ref="refChart" :aria-label="title"></canvas>
</div> </div>
...@@ -36,10 +27,6 @@ const props = defineProps({ ...@@ -36,10 +27,6 @@ const props = defineProps({
simple: { simple: {
type: Boolean, type: Boolean,
default: false default: false
},
info: {
type: Object,
default: () => {}
} }
}) })
const refChart = ref(null) const refChart = ref(null)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册