跳到主要内容

Empty 空数据

某些列表数据为空时可以用这个组件显示

示例​

import { Header, ScrollView, TopView, GroupList, Empty, Button } from '@/duxuiExample'

export default function EmptyExample() {

return <TopView>
<Header title='Empty' />
<ScrollView>
<GroupList>
<GroupList.Item title='空状态' desc=''>
<Empty />
</GroupList.Item>
<GroupList.Item title='自定义标题' desc=''>
<Empty title='自定义标题' />
</GroupList.Item>
<GroupList.Item title='自定义图片' desc=''>
<Empty url='https://th.bing.com/th/id/OIP.EwSXHHL2QXAeJzrA-87orQHaFj?pid=ImgDet&rs=1' />
</GroupList.Item>
<GroupList.Item title='底部自定义' desc=''>
<Empty
renderFooter={<Button>底部自定义</Button>}
/>
</GroupList.Item>
</GroupList>
</ScrollView>
</TopView>
}

Props​

继承自Taro的View Props

title​

标题

类型必填默认值
string否什么都没有~

url​

用于替换默认的图片

类型必填默认值
string否

icon​

用于替换默认的图片

类型必填默认值
string否

renderIcon​

自定义渲染替换图片区域

类型必填默认值
ReactElement否

renderFooter​

底部自定义渲染

类型必填默认值
ReactElement否