增加获取场馆、字典
This commit is contained in:
16
src/app.ts
16
src/app.ts
@@ -1,18 +1,32 @@
|
||||
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<AppProps> {
|
||||
componentDidMount() {}
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user