feat: 新增主题色选项

This commit is contained in:
MTrun
2022-02-06 01:04:05 +08:00
parent 27f416a46e
commit 483d1eb5e8
51 changed files with 698 additions and 174 deletions
@@ -1,17 +1,13 @@
import { getUUID } from '@/utils'
import { echartOptionProfixHandle } from '@/packages/utils/chart'
import { echartOptionProfixHandle, publicConfig } from '@/packages/utils'
import { BarCrossrangefig } from './index'
import { ConfigType, CreateComponentType } from '@/packages/index.d'
import omit from 'lodash/omit'
export default class Config implements CreateComponentType {
public id: string = getUUID()
export default class Config extends publicConfig implements CreateComponentType {
public key: string = BarCrossrangefig.key
public chartData: Exclude<ConfigType, ['node']> = omit(BarCrossrangefig, ['node'])
public attr = { x: 0, y: 0, w: 500, h: 300 }
// 图表配置项
public option = echartOptionProfixHandle({
backgroundColor: 'rgba(0,0,0,0)',
@@ -1,5 +1,5 @@
<template>
<VChart theme="dark" :option="option" autoresize />
<VChart :theme="themeData" :option="option" autoresize />
</template>
<script setup lang="ts">
@@ -16,6 +16,11 @@ import {
import config from './config'
const props = defineProps({
themeData: {
type: Object || String,
default: 'dark',
required: true
},
chartData: {
type: Object as PropType<config>,
required: true