dashboard (#6)
* feat(dashboard): 增加dashboard示例 * feat(chart-ui): 增加图表UI组件库 * feat(dashboard): 完善dashboard示例
This commit is contained in:
24
packages/business/universal-ui/src/dashboard/chartCard.vue
Normal file
24
packages/business/universal-ui/src/dashboard/chartCard.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user