修复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',
radius: ['40%', '70%'],
// avoidLabelOverlap: false,
top: '20%',
itemStyle: {
borderRadius: 10
@ -70,6 +71,8 @@ const initChart = () => {
position: 'center'
},
emphasis: {
scale: true,
scaleSize: 5,
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
@ -79,9 +82,9 @@ const initChart = () => {
labelLine: {
show: true
},
hoverOffset: 15, //
// hoverOffset: 15, //
still: false, //
silent: true, //
cursor: 'pointer',
//
hoverAnimationThreshold: 1, //
selectedOffset: 10, //
@ -94,7 +97,8 @@ const initChart = () => {
onMounted(() => {
// DOM
setTimeout(initChart, 0)
window.addEventListener('resize', initChart)
// window.addEventListener('resize', initChart)
window.addEventListener('resize', initChart);
})
onUnmounted(() => {
@ -103,6 +107,7 @@ onUnmounted(() => {
chartInstance = null
}
window.removeEventListener('resize', initChart)
})
//
@ -120,9 +125,13 @@ watch(() => props.data, () => {
<style scoped>
.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>