From 9ad63297f14716892826c503953eb9b45b6c8321 Mon Sep 17 00:00:00 2001 From: rex Date: Wed, 3 Sep 2025 16:09:04 +0800 Subject: [PATCH] init --- src/pages/home/index.tsx | 13 +++++++++---- src/utils/mujian.ts | 7 ++++++- 2 files changed, 15 insertions(+), 5 deletions(-) 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 ( <>
@@ -19,17 +20,21 @@ function Home() { + +

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; +};