import { Component, ReactNode } from "react"; import "./nutui-theme.scss"; import "./app.scss"; import "qweather-icons/font/qweather-icons.css"; import { useGlobalStore } from "./store/global"; interface AppProps { children: ReactNode; } class App extends Component { onLaunch(options) { console.log('launch options: ', options) console.log("小程序启动,初始化逻辑写这里"); } componentDidMount() { // 初始化字典数据 this.getNavBarHeight(); // this.getLocation() } componentDidShow() {} componentDidHide() {} // 获取导航高度 getNavBarHeight = () => { const { getNavbarHeightInfo } = useGlobalStore.getState(); getNavbarHeightInfo(); }; // 获取位置信息 // getLocation = () => { // const { getCurrentLocationInfo } = useGlobalStore.getState() // getCurrentLocationInfo() // } render() { // this.props.children 是将要会渲染的页面 return this.props.children; } } export default App;