diff --git a/src/components/RChart/helper.ts b/src/components/RChart/helper.ts index 9a6589f3..8b012084 100644 --- a/src/components/RChart/helper.ts +++ b/src/components/RChart/helper.ts @@ -26,12 +26,12 @@ import type { * 1. 配置、选择主题 * 2. 点击下载主题 * 3. 选择 json 类型,然后复制 - * 4. 在 @/components/RayChart/theme 包中创建对应的 json 文件,文件名为主题名称 + * 4. 在 @/components/RChart/theme 包中创建对应的 json 文件,文件名为主题名称 */ export const setupChartTheme = () => { // 获取所有主题 const themeRawModules: Record = - import.meta.glob('@/components/RayChart/theme/**/*.json', { + import.meta.glob('@/components/RChart/theme/**/*.json', { eager: true, }) const regx = /\/([^/]+)\.json$/ diff --git a/src/components/RChart/index.tsx b/src/components/RChart/index.tsx index 9099a691..50fbd7de 100644 --- a/src/components/RChart/index.tsx +++ b/src/components/RChart/index.tsx @@ -66,8 +66,8 @@ import type { ECharts, EChartsCoreOption, SetOptionOpts } from 'echarts/core' export type EChartsExtensionInstallRegisters = typeof CanvasRenderer export type { RayChartInst } from './type' -const RayChart = defineComponent({ - name: 'RayChart', +export default defineComponent({ + name: 'RChart', props: { width: { /** @@ -369,7 +369,7 @@ const RayChart = defineComponent({ call(onError) } - console.error('RayChart render error: ', e) + console.error('RChart render error: ', e) } } @@ -413,7 +413,7 @@ const RayChart = defineComponent({ // 避免重复渲染 if (echartInstance?.getDom()) { console.warn( - 'RayChart mount: There is a chart instance already initialized on the dom. Execution was interrupted', + 'RChart mount: There is a chart instance already initialized on the dom. Execution was interrupted', ) return @@ -555,5 +555,3 @@ const RayChart = defineComponent({ ) }, }) - -export default RayChart diff --git a/src/views/demo/echart/index.tsx b/src/views/demo/echart/index.tsx index 4a6f0070..9e157a28 100644 --- a/src/views/demo/echart/index.tsx +++ b/src/views/demo/echart/index.tsx @@ -1,7 +1,7 @@ import './index.scss' import { NCard, NSwitch, NSpace, NP, NH2, NButton } from 'naive-ui' -import RayChart from '@/components/RChart/index' +import RChart from '@/components/RChart/index' import dayjs from 'dayjs' @@ -270,7 +270,7 @@ const Echart = defineComponent({
- 不跟随主题切换的暗色主题可视化图
-
- +
贴画可视化图
- +
)