0
点赞
收藏
分享

微信扫一扫

好客租房154-封装顶部导航栏组件(1顶部导航栏)


1封装NavHeader组件实现城市选择 地图找房页面的复用

2在component目录中创建NavHeader/index.js

import React from 'react'
import { NavBar } from 'antd-mobile'
export default function NavHeader({children}) {
return (
<NavBar
className="navbar"
mode="light"
icon={<i className="iconfont icon-back" />}
onLeftClick={() => this.props.histoty.push.go(-1)}
// 导航栏右边内容
// rightContent={[
// <Icon
// key="0"
// type="search"
// style={{ marginRight: '16px' }}
// />,
// <Icon key="1" type="ellipsis" />,
// ]}
>
{children}
</NavBar>
)
}

总结

好客租房154-封装顶部导航栏组件(1顶部导航栏)_javascript

举报

相关推荐

0 条评论