\u9080\u8bf7\u7801\u5df2\u7528\u4f46\u6301\u6709\u4eba\u88ab\u6ce8\u9500\u65f6\u7ba1\u7406\u9875\u5c55\u793a\u5df2\u9500\u6237\u5f82\u7ae0\u4e0e\u7b5b\u9009\u3002
2 lines
822 B
JavaScript
2 lines
822 B
JavaScript
import{r}from"./index-Dplf5hVV.js";import{g as f}from"./echarts-BIWefrIc.js";function p(){const[n,o]=r.useState(0);return r.useEffect(()=>{const s=()=>o(t=>t+1);return window.addEventListener("fp-theme-change",s),()=>window.removeEventListener("fp-theme-change",s)},[]),n}function d(n){return getComputedStyle(document.documentElement).getPropertyValue("--text-"+n).trim()||"#454e5c"}function h(n,o){const s=r.useRef(null),[t,i]=r.useState(null),u=r.useRef(n);return u.current=n,r.useEffect(()=>{if(!t)return;const e=f(t);s.current=e,e.setOption(u.current(),{notMerge:!0});const c=new ResizeObserver(()=>e.resize());return c.observe(t),()=>{c.disconnect(),e.dispose(),s.current=null}},[t]),r.useEffect(()=>{var e;(e=s.current)==null||e.setOption(u.current(),{notMerge:!0})},[t,...o]),e=>i(e)}export{h as a,d as i,p as u};
|