fix: 解决高版本TS错误问题

This commit is contained in:
奔跑的面条 2023-12-16 21:26:16 +08:00
parent 4f21020d24
commit 3e641e4bab
3 changed files with 157 additions and 140 deletions

View File

@ -1,10 +1,18 @@
<template> <template>
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option" :manual-update="isPreview()" autoresize></v-chart> <v-chart
ref="vChartRef"
:init-options="initOptions"
:theme="themeColor"
:option="(option as EChartsOption)"
:manual-update="isPreview()"
autoresize
></v-chart>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, PropType } from 'vue' import { computed, PropType } from 'vue'
import VChart from 'vue-echarts' import VChart from 'vue-echarts'
import { EChartsOption } from 'echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook' import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import { use } from 'echarts/core' import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers' import { CanvasRenderer } from 'echarts/renderers'

View File

@ -3,7 +3,7 @@
ref="vChartRef" ref="vChartRef"
:init-options="initOptions" :init-options="initOptions"
:theme="themeColor" :theme="themeColor"
:option="option" :option="(option as EChartsOption)"
:manual-update="isPreview()" :manual-update="isPreview()"
autoresize autoresize
></v-chart> ></v-chart>
@ -12,6 +12,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, PropType, watch } from 'vue' import { ref, computed, PropType, watch } from 'vue'
import VChart from 'vue-echarts' import VChart from 'vue-echarts'
import { EChartsOption } from 'echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook' import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import dataJson from './data.json' import dataJson from './data.json'
import { use } from 'echarts/core' import { use } from 'echarts/core'

View File

@ -1,10 +1,18 @@
<template> <template>
<v-chart ref="vChartRef" :init-options="initOptions" :theme="themeColor" :option="option" :manual-update="isPreview()" autoresize></v-chart> <v-chart
ref="vChartRef"
:init-options="initOptions"
:theme="themeColor"
:option="(option as EChartsOption)"
:manual-update="isPreview()"
autoresize
></v-chart>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch, computed, PropType } from 'vue' import { ref, watch, computed, PropType } from 'vue'
import VChart from 'vue-echarts' import VChart from 'vue-echarts'
import { EChartsOption } from 'echarts'
import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook' import { useCanvasInitOptions } from '@/hooks/useCanvasInitOptions.hook'
import dataJson from './data.json' import dataJson from './data.json'
import { use } from 'echarts/core' import { use } from 'echarts/core'