Skip to content
API 风格:

Result Result ​

LhResult result feedback page: status icon, title, subtitle and extra actions with role="status".

Basic Usage ​

Four Statuses
Success
Warning
Error
Info
vue
<script setup lang="ts">
import { LhResult } from '@lh-ui/vue3'

const t1 = {
  success: 'Success',
  warning: 'Warning',
  error: 'Error',
  info: 'Info',
}
</script>

<template>
<div class="demo-row">
  <LhResult status="success" :title="t1.success" />
  <LhResult status="warning" :title="t1.warning" />
  <LhResult status="error" :title="t1.error" />
  <LhResult status="info" :title="t1.info" />
</div>
</template>
vue
<script>
import { LhResult } from '@lh-ui/vue3'

export default {
  components: { LhResult },
  data() {
    return {
      t1: {
      success: 'Success',
      warning: 'Warning',
      error: 'Error',
      info: 'Info',
    },
    }
  },
}
</script>

<template>
<div class="demo-row">
  <LhResult status="success" :title="t1.success" />
  <LhResult status="warning" :title="t1.warning" />
  <LhResult status="error" :title="t1.error" />
  <LhResult status="info" :title="t1.info" />
</div>
</template>
Subtitle & Extra
Validation failed
Please check the highlighted fields and retry
vue
<script setup lang="ts">
import { LhResult } from '@lh-ui/vue3'

const t2 = {
  warnTitle: 'Validation failed',
  warnSub: 'Please check the highlighted fields and retry',
}
</script>

<template>
<LhResult
  status="warning"
  :title="t2.warnTitle"
  :sub-title="t2.warnSub"
>
  <template #extra>
    <LhButton type="primary">Back and retry</LhButton>
  </template>
</LhResult>
</template>
vue
<script>
import { LhResult } from '@lh-ui/vue3'

export default {
  components: { LhResult },
  data() {
    return {
      t2: {
      warnTitle: 'Validation failed',
      warnSub: 'Please check the highlighted fields and retry',
    },
    }
  },
}
</script>

<template>
<LhResult
  status="warning"
  :title="t2.warnTitle"
  :sub-title="t2.warnSub"
>
  <template #extra>
    <LhButton type="primary">Back and retry</LhButton>
  </template>
</LhResult>
</template>

Result API ​

Props ​

NameDescriptionTypeDefault
statusResult status"success" | "warning" | "info" | "error"'info'
iconCustom icon name (empty string hides the icon)string—
iconSizeIcon sizestring | number64
titleTitle (or title slot)string''
subTitleSubtitle (or subTitle slot)string''
sxQuick layout propsLhSxProps—

Slots ​

NameDescription
titleTitle
subTitleSubtitle
extraExtra actions

Accessibility ​

  • The container is role="status": announced when the result appears

Type Definitions ​

The TypeScript type structures exported by this component (auto-extracted from packages/components/result/src/types.ts and @lh-ui/share/core/* sources; click each entry to expand; see the Props table above for attribute descriptions):

LhResultProps
ts
export interface LhResultProps {
  status?: LhResultStatus
  icon?: string
  iconSize?: string | number
  title?: string
  subTitle?: string
  sx?: LhSxProps
}

Beauty of tradition, foundation of code