修复bug

This commit is contained in:
梁泽军 2025-03-21 18:01:11 +08:00
parent 538de6d717
commit 20f1b260d7

View File

@ -61,6 +61,7 @@ const initChart = () => {
type: 'pie', type: 'pie',
radius: ['40%', '70%'], radius: ['40%', '70%'],
// avoidLabelOverlap: false, // avoidLabelOverlap: false,
top: '20%', top: '20%',
itemStyle: { itemStyle: {
borderRadius: 10 borderRadius: 10
@ -70,6 +71,8 @@ const initChart = () => {
position: 'center' position: 'center'
}, },
emphasis: { emphasis: {
scale: true,
scaleSize: 5,
itemStyle: { itemStyle: {
shadowBlur: 10, shadowBlur: 10,
shadowOffsetX: 0, shadowOffsetX: 0,
@ -79,9 +82,9 @@ const initChart = () => {
labelLine: { labelLine: {
show: true show: true
}, },
hoverOffset: 15, // // hoverOffset: 15, //
still: false, // still: false, //
silent: true, // cursor: 'pointer',
// //
hoverAnimationThreshold: 1, // hoverAnimationThreshold: 1, //
selectedOffset: 10, // selectedOffset: 10, //
@ -94,7 +97,8 @@ const initChart = () => {
onMounted(() => { onMounted(() => {
// DOM // DOM
setTimeout(initChart, 0) setTimeout(initChart, 0)
window.addEventListener('resize', initChart) // window.addEventListener('resize', initChart)
window.addEventListener('resize', initChart);
}) })
onUnmounted(() => { onUnmounted(() => {
@ -103,6 +107,7 @@ onUnmounted(() => {
chartInstance = null chartInstance = null
} }
window.removeEventListener('resize', initChart) window.removeEventListener('resize', initChart)
}) })
// //
@ -120,9 +125,13 @@ watch(() => props.data, () => {
<style scoped> <style scoped>
.chart-container { .chart-container {
touch-action: manipulation; /* touch-action: manipulation; */
/* 优化移动端触控 */ /* 优化移动端触控 */
-webkit-tap-highlight-color: transparent; /* -webkit-tap-highlight-color: transparent; */
/* 移除点击高光 */ /* 移除点击高光 */
-webkit-user-select: none;
user-select: none;
/* 优化点击反馈 */
transition: filter 0.2s;
} }
</style> </style>