Commit 2113a2c9 by qlintonger xeno

feat: 重设结构变体+2

parent 590cb3b2
<template> <template>
<template v-if="ps.type === ChartCompType.EChartsBar"> <template v-if="ps.type === ChartCompType.EChartsBar">
<global-echarts v-bind="$attrs" :height="ps.height" :width="ps.width" :options="ps.options"/> <global-echarts v-bind="$attrs" :height="ps.item.chartWidth" :width="ps.item.chartHeight" :options="ps.options"/>
</template> </template>
<template v-else-if="ps.type === ChartCompType.EChartsPie"> <template v-else-if="ps.type === ChartCompType.EChartsPie">
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
......
...@@ -5,6 +5,8 @@ export type BarChartOptions = { ...@@ -5,6 +5,8 @@ export type BarChartOptions = {
category: string[] category: string[]
data: number[] | { name: string, data: number[] }[], data: number[] | { name: string, data: number[] }[],
type: ChartCompType type: ChartCompType
chartWidth?: number | string
chartHeight?: number | string
}; };
export type PieCharOptions = { export type PieCharOptions = {
...@@ -13,6 +15,8 @@ export type PieCharOptions = { ...@@ -13,6 +15,8 @@ export type PieCharOptions = {
radius: Array<string>, radius: Array<string>,
data: Array<{value: number, name: string, color: string}>, data: Array<{value: number, name: string, color: string}>,
centerText?: string | Function centerText?: string | Function
chartWidth?: number | string
chartHeight?: number | string
} }
export type GeneralChartOptions = BarChartOptions | PieCharOptions export type GeneralChartOptions = BarChartOptions | PieCharOptions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment