Skip to content

Empty Empty-State Component

This component is used for scenarios where content needs to be loaded but the first page of loaded data is empty, displaying a "no content" prompt. We have carefully selected a dozen or so scenario-specific icons for your convenience.

📌 Platform Compatibility

APP(vue)H5WeChat Mini ProgramAlipay Mini Program

🏯 Basic Usage Examples

html
<!-- Global usage -->
<hy-empty></hy-empty>

Displaying and Configuring the Button

  • btnText Text displayed on the button
  • btnSize Button size
  • btnShape Button shape
  • btnPlain Whether the button is outlined
  • navigateUrl Page to navigate to
html
<template>
    <hy-empty
        btnText="Go Shopping"
        btnSize="mini"
        btnShape="circle"
        btnPlain
        navigateUrl="/pages/abc/Index"
    ></hy-empty>
</template>

Configuring the Prompt Text

  • desSize Prompt text size
  • desColor Prompt text color
html
<template>
    <hy-empty desColor="red" desSize="10px"></hy-empty>
</template>

Custom Slots

html
<template>
    <hy-empty>
        <template #description>Custom description content</template>
    </hy-empty>

    <hy-empty>
        <template>Custom default slot</template>
    </hy-empty>
</template>

API

Empty Props

ParameterDescriptionTypeDefault
showWhether to show the componentbooleantrue
modeEmpty page contentstringcontent
imageUrlEmpty state icon imagestring-
zIndexComponent z-indexnumber889
widthImage width, numbers default to px unitstring|number240px
heightImage height, numbers default to px unitstring|number240px
descriptionPrompt messagestringNo data yet
desSizePrompt message size, numbers default to px unitstring|number15
desColorPrompt message colorstring-
imgMarginIcon image marginstring-
buttonCollection of button properties, displayed when text has a value, see Button API for detailsHyButtonProps-
navigateUrlNavigation URLstring-
customStyleCustom outer style of the input boxCSSProperties-
customClassCustom outer class namestring-

Events

Event NameDescriptionCallback Parameters
clickFunction executed when the button is clicked-

Slots

Slot NameDescriptionAccepted Values
defaultDefault slot-
descriptionCustom bottom description-
03:29