mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-30 17:20:10 +08:00
feat: 优化饼图半径修复的写法
This commit is contained in:
parent
729c81aa61
commit
7309aa2e03
@ -26,8 +26,6 @@ import { isPreview } from '@/utils'
|
||||
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||
import dataJson from './data.json'
|
||||
|
||||
const isInit = ref<boolean>(false)
|
||||
|
||||
const props = defineProps({
|
||||
themeSetting: {
|
||||
type: Object,
|
||||
@ -106,9 +104,9 @@ watch(
|
||||
newData => {
|
||||
try {
|
||||
// 防止初始化时触发修改,导致部分参数丢失
|
||||
if (!isInit.value) {
|
||||
isInit.value = true
|
||||
} else {
|
||||
if (isPreview()) {
|
||||
return
|
||||
}
|
||||
if (newData === 'nomal') {
|
||||
props.chartConfig.option.series[0].radius = '70%'
|
||||
props.chartConfig.option.series[0].roseType = false
|
||||
@ -119,7 +117,6 @@ watch(
|
||||
props.chartConfig.option.series[0].radius = '70%'
|
||||
props.chartConfig.option.series[0].roseType = true
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user