* feat(dashboard): 增加dashboard示例 * feat(chart-ui): 增加图表UI组件库 * feat(dashboard): 完善dashboard示例
25 lines
545 B
Vue
25 lines
545 B
Vue
<script lang="ts" setup>
|
|
import { chart } from '@vben/chart-ui';
|
|
defineOptions({ name: 'ChartCard' });
|
|
import type { ChartItem } from './typings';
|
|
import { onMounted, ref } from 'vue';
|
|
interface Props {
|
|
item: ChartItem;
|
|
}
|
|
const chartRef = ref();
|
|
onMounted(() => {
|
|
chartRef.value.setChart(props.item.option);
|
|
});
|
|
|
|
const props = withDefaults(defineProps<Props>(), {});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="rounded-lg border-2 border-solid">
|
|
<div class="">
|
|
{{ item.title }}
|
|
</div>
|
|
<chart ref="chartRef" />
|
|
</div>
|
|
</template>
|