Result 結果
LhResult 結果フィードバック:ステータスアイコン、タイトル、サブタイトル。
基本的な使い方
4つのステータス
成功
警告
エラー
情報
vue
<script setup lang="ts">
import { LhResult } from '@lh-ui/vue3'
const t1 = {
success: '成功',
warning: '警告',
error: 'エラー',
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: '成功',
warning: '警告',
error: 'エラー',
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 setup lang="ts">
import { LhResult } from '@lh-ui/vue3'
const t2 = {
warnTitle: '検証に失敗しました',
warnSub: 'ハイライトされた項目を確認してください',
}
</script>
<template>
<LhResult
status="warning"
:title="t2.warnTitle"
:sub-title="t2.warnSub"
>
<template #extra>
<LhButton type="primary">戻って再試行</LhButton>
</template>
</LhResult>
</template>vue
<script>
import { LhResult } from '@lh-ui/vue3'
export default {
components: { LhResult },
data() {
return {
t2: {
warnTitle: '検証に失敗しました',
warnSub: 'ハイライトされた項目を確認してください',
},
}
},
}
</script>
<template>
<LhResult
status="warning"
:title="t2.warnTitle"
:sub-title="t2.warnSub"
>
<template #extra>
<LhButton type="primary">戻って再試行</LhButton>
</template>
</LhResult>
</template>Result API
プロパティ
| 名前 | 説明 | 型 | デフォルト |
|---|---|---|---|
| status | 結果ステータス | LhResultStatus | 'info' |
| icon | カスタムアイコン名 | string | — |
| iconSize | アイコンサイズ | string | number | 64 |
| title | タイトル | string | '' |
| subTitle | サブタイトル | string | '' |
| sx | クイックレイアウト | LhSxProps | — |
スロット
| 名前 | 説明 |
|---|---|
| title | タイトル |
| subTitle | サブタイトル |
| extra | 操作領域 |
アクセシビリティ
- コンテナは
role="status"

