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 {
|
export {
|
||||||
mapDefaultProps
|
mapDefaultProps
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import { mapDefaultProps } from '../../models/utils';
|
|||||||
import './index.scss';
|
import './index.scss';
|
||||||
import { IndexProps, IndexState } from './type';
|
import { IndexProps, IndexState } from './type';
|
||||||
|
|
||||||
@connect(mapDefaultProps)
|
@connect(mapDefaultProps(Index))
|
||||||
export default class Index extends Component<IndexProps, IndexState> {
|
class Index extends Component<IndexProps, IndexState> {
|
||||||
config: Config = {
|
config: Config = {
|
||||||
navigationBarTitleText: '首页',
|
navigationBarTitleText: '首页',
|
||||||
enablePullDownRefresh: true
|
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 './index.scss';
|
||||||
import { MyIndexProps, MyState } from './type';
|
import { MyIndexProps, MyState } from './type';
|
||||||
|
|
||||||
@connect(mapDefaultProps)
|
@connect(mapDefaultProps(My))
|
||||||
class Index extends Component<MyIndexProps, MyState> {
|
class My extends Component<MyIndexProps, MyState> {
|
||||||
config: Config = {
|
config: Config = {
|
||||||
navigationBarTitleText: '个人中心',
|
navigationBarTitleText: '个人中心',
|
||||||
enablePullDownRefresh: true
|
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