Result
Presents success, error, warning, information and waiting outcomes with application actions.
Import
Use <hui-result> after configuring uni-app easycom. Import public types and functions from @nscode/handy-uni. Ordinary Vue applications install the @nscode/handy-uni/web preview plugin.
Examples
Each example is standalone. Controls show the current value or event result on the page.
<template>
<view>
<hui-space direction="vertical" fill>
<hui-result
v-for="status in statuses"
:key="status"
custom-class="hui-space__item"
:status="status"
:subtitle="'状态 / Status: ' + status"
>
<template #extra><hui-button @click="lastEvent = status">查看 / View</hui-button></template>
</hui-result>
<text class="hui-space__item">{{ lastEvent }}</text>
</hui-space>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const lastEvent = ref('尚无事件 / No event')
const statuses = ['success', 'error', 'warning', 'info', 'waiting'] as const
</script>
Props
| Prop | Type | Default | Details |
|---|---|---|---|
status | ResultStatus | 'info' | Semantic visual status. |
title | string | — | Uses the translated status title when omitted; '' hides the title. |
subtitle | string | — | Secondary heading. |
icon | string | — | Icon registry name. |
iconSize | number | 64 | Icon size in px. |
fullPage | boolean | false | Centers content in a full-page result layout. |
Root classes and styles use customClass and customStyle. Numbers representing dimensions use px; durations use ms unless explicitly documented.
Events
None.
Slots
| Slot | Scope |
|---|---|
icon | — |
title | — |
subtitle | — |
default | — |
extra | — |
Actions in extra stack vertically. The corresponding container is omitted when the default or extra slot is absent.
Methods
None.
Types
ResultStatus、ResultProps、ResultEmits.
Theme variables
--hui-result-icon-size controls the default icon and takes priority over iconSize. When unset, iconSize supplies the fallback, which defaults to 64px. A custom icon slot controls its own content size.
Platform notes
Supports H5, WeChat mini-program, App-vue and ordinary Vue 3 Web through shared platform components. Unit tests do not replace device acceptance; verify touch, screen readers, deactivation and native rendering on each target.
Device smoke checklist.