24 lines
548 B
TypeScript
24 lines
548 B
TypeScript
import { PropsWithChildren } from "react";
|
|
import { useLaunch } from "@tarojs/taro";
|
|
import { RecoilRoot } from "recoil";
|
|
import { getGlobalConfig } from "@/apis";
|
|
|
|
import "@/styles/tailwind.basic.css";
|
|
|
|
function App({ children }: PropsWithChildren<any>) {
|
|
useLaunch(() => {
|
|
loadGlobalConfig();
|
|
console.log("App launched.");
|
|
});
|
|
|
|
// 初始化全局配置
|
|
const loadGlobalConfig = async () => {
|
|
const res = await getGlobalConfig();
|
|
console.log(res);
|
|
};
|
|
|
|
return <RecoilRoot>{children}</RecoilRoot>;
|
|
}
|
|
|
|
export default App;
|