27 lines
728 B
Vue
27 lines
728 B
Vue
|
|
<template>
|
|||
|
|
<qiun-data-charts :type="type" :chartData="chartData" :opts="opts"/>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
export default {
|
|||
|
|
// 定义接收的属性(替代 Vue3 的 defineProps)
|
|||
|
|
props: {
|
|||
|
|
// 图表类型(如line、column、pie等)
|
|||
|
|
type: {
|
|||
|
|
type: String,
|
|||
|
|
required: true // 图表类型为必填项
|
|||
|
|
},
|
|||
|
|
// 图表数据(包含categories和series等)
|
|||
|
|
chartData: {
|
|||
|
|
type: Object,
|
|||
|
|
required: true // 图表数据为必填项
|
|||
|
|
},
|
|||
|
|
// 图表配置项(如样式、坐标轴设置等)
|
|||
|
|
opts: {
|
|||
|
|
type: Object,
|
|||
|
|
default: () => ({}) // 配置项默认为空对象
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
</script>
|