feat: simpleify code
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
9de6a1eb36
commit
d66c64fdff
@ -1,6 +1,5 @@
|
||||
let mapDefaultProps = ({ def }) => ({ ...def })
|
||||
let mapDefaultProps = (obj: any) => ((def) => ({ ...def[obj.name.toLowerCase()] }))
|
||||
|
||||
export {
|
||||
mapDefaultProps
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,8 @@ import { mapDefaultProps } from '../../models/utils';
|
||||
import './index.scss';
|
||||
import { IndexProps, IndexState } from './type';
|
||||
|
||||
@connect(mapDefaultProps)
|
||||
export default class Index extends Component<IndexProps, IndexState> {
|
||||
@connect(mapDefaultProps(Index))
|
||||
class Index extends Component<IndexProps, IndexState> {
|
||||
config: Config = {
|
||||
navigationBarTitleText: '首页',
|
||||
enablePullDownRefresh: true
|
||||
@ -55,3 +55,5 @@ export default class Index extends Component<IndexProps, IndexState> {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Index
|
||||
|
@ -10,8 +10,8 @@ import defaultImage from '../../assets/images/logo.png';
|
||||
import './index.scss';
|
||||
import { MyIndexProps, MyState } from './type';
|
||||
|
||||
@connect(mapDefaultProps)
|
||||
class Index extends Component<MyIndexProps, MyState> {
|
||||
@connect(mapDefaultProps(My))
|
||||
class My extends Component<MyIndexProps, MyState> {
|
||||
config: Config = {
|
||||
navigationBarTitleText: '个人中心',
|
||||
enablePullDownRefresh: true
|
||||
@ -103,4 +103,4 @@ class Index extends Component<MyIndexProps, MyState> {
|
||||
}
|
||||
}
|
||||
|
||||
export default Index
|
||||
export default My
|
||||
|
Loading…
Reference in New Issue
Block a user