mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-12 00:00:01 +08:00
feat: 新增预览接口数据动态获取功能
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-chart :theme="themeColor" :option="option" autoresize></v-chart>
|
||||
<v-chart ref="vChartRef" :theme="themeColor" :option="option" :manual-update="isPreview()" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -12,6 +12,7 @@ import { includes } from './config'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import { useChartDataFetch } from '@/hooks/useChartDataFetch.hook'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { isPreview } from '@/utils'
|
||||
import {
|
||||
DatasetComponent,
|
||||
GridComponent,
|
||||
@@ -47,5 +48,5 @@ const option = computed(() => {
|
||||
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||
})
|
||||
|
||||
useChartDataFetch(props.chartConfig)
|
||||
const { vChartRef } = useChartDataFetch(props.chartConfig)
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-chart :theme="themeColor" :option="option" autoresize></v-chart>
|
||||
<v-chart ref="vChartRef" :theme="themeColor" :option="option" :manual-update="isPreview()" autoresize></v-chart>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -11,6 +11,7 @@ import { BarChart } from 'echarts/charts'
|
||||
import { mergeTheme } from '@/packages/public/chart'
|
||||
import config, { includes } from './config'
|
||||
import { useChartDataFetch } from '@/hooks/useChartDataFetch.hook'
|
||||
import { isPreview } from '@/utils'
|
||||
import {
|
||||
DatasetComponent,
|
||||
GridComponent,
|
||||
@@ -46,5 +47,5 @@ const option = computed(() => {
|
||||
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||
})
|
||||
|
||||
useChartDataFetch(props.chartConfig)
|
||||
const { vChartRef } = useChartDataFetch(props.chartConfig)
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user