diff --git a/src/pages/home/index.tsx b/src/pages/home/index.tsx index a415143..a122749 100644 --- a/src/pages/home/index.tsx +++ b/src/pages/home/index.tsx @@ -1,7 +1,7 @@ import { useGlobalStore } from '@/store/global'; import './index.css'; import { isEmpty } from 'lodash-es'; -import { EVENT, mujian } from '@/utils/mujian'; +import { EVENT, getMujian } from '@/utils/mujian'; function Home() { const { count, increment } = useGlobalStore((state) => state); @@ -10,6 +10,7 @@ function Home() { console.log('isEmpty', isEmpty(count)); + return ( <>
Count: {count}
+ +Count: {count}
> ); } diff --git a/src/utils/mujian.ts b/src/utils/mujian.ts index e415155..65b01e7 100644 --- a/src/utils/mujian.ts +++ b/src/utils/mujian.ts @@ -5,4 +5,9 @@ const mujian = new MujianSdk(); await mujian.init(); -export { mujian, EVENT }; +export { EVENT }; + +export const getMujian = async () => { + await mujian.init(); + return mujian; +};