1,面包屑導(dǎo)航父子組件傳值

image.png
父頁面.jsx
# 定義一個數(shù)組
this.state = {
data: [
{ pages: '數(shù)據(jù)可視化AAA', path: '/數(shù)據(jù)可視化22'},
{ pages: '我的數(shù)據(jù)集', path: '/我的數(shù)據(jù)集22'},
]
};
# 引入組件,傳遞數(shù)據(jù)
<Crumbs data={this.state.data}/>
子頁面.jsx
# props屬性接收數(shù)據(jù)
{
this.props.data.map((item, index) => {
return (
<Breadcrumb.Item className='GotoPages' href={item.path} key={index}>
<span className='GotoPagesText'>{item.pages}</span>
</Breadcrumb.Item>
)
})
}