fix: register charts and components to avoid build error

This commit is contained in:
skie1997 2025-02-24 15:00:48 +08:00
parent 88e3cc19c8
commit 00578479e3
2 changed files with 30 additions and 1 deletions

View File

@ -9,9 +9,13 @@
<script setup lang="ts">
import { ref, PropType, watch, onBeforeUnmount, nextTick, toRaw, toRefs } from 'vue'
import { VChart, type IVChart, type IInitOption, type ISpec } from '@visactor/vchart'
import { VChart, type IVChart, type IInitOption } from '@visactor/vchart'
import { transformHandler } from './transformProps'
import { IOption } from '@/packages/components/VChart/index.d'
import { registerChartsAndComponents } from './register'
// VChart:
registerChartsAndComponents()
// v1.13.0 https://www.visactor.io/vchart/api/API/event
const event = [

View File

@ -0,0 +1,25 @@
import { VChart } from '@visactor/vchart/esm/core';
import { registerBarChart, registerAreaChart, registerLineChart, registerPieChart, registerFunnelChart, registerWordCloudChart, registerScatterChart } from '@visactor/vchart/esm/chart';
import { registerTooltip, registerCartesianCrossHair, registerDiscreteLegend, registerLabel } from '@visactor/vchart/esm/component';
import { registerDomTooltipHandler } from '@visactor/vchart/esm/plugin/components';
export const registerChartsAndComponents = () => {
VChart.useRegisters([
// 图表
registerBarChart,
registerAreaChart,
registerLineChart,
registerPieChart,
registerScatterChart,
registerFunnelChart,
registerWordCloudChart,
// 组件
registerTooltip,
registerDomTooltipHandler,
registerCartesianCrossHair,
registerDiscreteLegend,
registerLabel
]);
}