Skip to content

AsyncStateContainer 异步状态容器

xy-async-state-container 用来收口页面级和区块级的异步状态。

基础用法

适合请求列表、详情区和面板容器的状态承载。

正在加载数据

当前定位

  • 统一 loading / error / empty / content 的承载结构。
  • 常与 RequestFormListPageDetailPage 一起使用。

AsyncStateContainer API

AsyncStateContainer Attributes

属性说明类型默认值
loading是否加载中,为 true 时优先展示加载态booleanfalse
error错误信息,非空时展示错误态string | nullnull
empty是否为空态,仅在非加载且无错误时生效booleanfalse
empty-title空态标题string'暂无数据'
empty-description空态描述string'当前条件下没有可展示的内容。'
loading-text加载态文案string'正在加载数据'

AsyncStateContainer Events

事件名说明参数
retry点击错误态内置的「重新加载」按钮时派发() => void

AsyncStateContainer Slots

插槽说明接收参数
default正常内容区
loading自定义加载态
error自定义错误态{ error: string | null }
empty自定义空态