front/src/views/home/workplace/biz-ops/useChartRemountOnActivate.ts
zzh ba565f7384
All checks were successful
Build and Deploy Front / deploy (push) Successful in 3m27s
feat: 工作台美区 ZIP3 与官网/登录体验收敛
补齐客户工作台地图 ZIP3/港口数据与 keep-alive 重挂,并轻量化官网导航弹层与可拖意图 IP,登录页改为居中舞台。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-12-03 15:10:05 +08:00

21 lines
517 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { nextTick, onActivated, ref, type Ref } from 'vue'
/**
* keep-alive 切页回来后,ECharts geo/map 常因隐藏态被 autoresize 成 0×0 而空白。
* 激活后等布局落稳再 bump key,强制重挂图表。
*/
export function useChartRemountOnActivate(ready: Ref<boolean>) {
const chartEpoch = ref(0)
onActivated(() => {
if (!ready.value) return
void nextTick(() => {
requestAnimationFrame(() => {
chartEpoch.value += 1
})
})
})
return { chartEpoch }
}