All checks were successful
Build and Deploy Front / deploy (push) Successful in 3m27s
补齐客户工作台地图 ZIP3/港口数据与 keep-alive 重挂,并轻量化官网导航弹层与可拖意图 IP,登录页改为居中舞台。 Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
517 B
TypeScript
21 lines
517 B
TypeScript
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 }
|
||
}
|