import { Component, ReactNode } from 'react' import './app.scss' import './nutui-theme.scss' import { useDictionaryStore } from './store/dictionaryStore' interface AppProps { children: ReactNode } class App extends Component { componentDidMount() { // 初始化字典数据 this.initDictionaryData() } componentDidShow() {} componentDidHide() {} // 初始化字典数据 private async initDictionaryData() { try { const { fetchDictionary } = useDictionaryStore.getState() await fetchDictionary() } catch (error) { console.error('初始化字典数据失败:', error) } } render() { // this.props.children 是将要会渲染的页面 return this.props.children } } export default App