Loading Loading
Display inline or full-screen loading feedback.
Import
Use <hui-loading> with uni-app easycom. Import public types from @nscode/handy-uni. For ordinary Vue 3, install the preview plugin from @nscode/handy-uni/web and register its components.
Examples
Interact with the controls to see values and event results on the page.
vue
<template>
<view>
<hui-loading text="加载中 / Loading" />
<hui-loading type="spinner" :size="28" vertical text="处理中 / Processing" /><hui-loading
type="circular"
:size="20"
color="var(--hui-color-primary)"
/>
<text>{{ lastEvent }}</text>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const lastEvent = ref('No event yet')
</script>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
type | LoadingType | 'circular' | Semantic type or input mode; see the type definition. |
size | string | number | 20 | Component size; inherits configuration when omitted. |
color | string | — | Color override; prefer theme variables. |
text | string | — | Display text; an explicit empty string suppresses fallback. |
vertical | boolean | false | Stack the loading indicator and text vertically. |
fullscreen | boolean | false | Cover the current positioning region with a loading state. |
Root attributes: common props. A Boolean default of undefined supports inheritance; explicit false overrides it. Other Boolean props default to false unless listed otherwise.
Events
None.
Slots
| Slot | Parameters | Description |
|---|---|---|
icon | — | Custom icon region; replaces its fallback content. |
default | — | Main content. |
Methods
None.
Types
LoadingProps、LoadingType are available from @nscode/handy-uni.
ts
export type LoadingType = 'spinner' | 'circular'
Platform notes
| Behavior | uni-app H5 | WeChat Mini Program | App-vue | Ordinary Vue 3 Web (preview) |
|---|---|---|---|---|
| Basic interaction | Supported; device checks pending | Supported; device checks pending | Supported; device checks pending | Supported by the web platform adapter |
Follow the smoke checklist. Device evidence is tracked separately; unit tests do not establish device acceptance.