首页 > 其他分享 >好客租房154-封装顶部导航栏组件(1顶部导航栏)

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

时间:2023-02-10 16:04:56浏览次数:45  
标签:封装 154 顶部 组件 NavHeader 导航 children


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顶部导航栏)_react.js

标签:封装,154,顶部,组件,NavHeader,导航,children
From: https://blog.51cto.com/u_15460007/6049551

相关文章