# Empty 空狀態
空資料時的佔位展示。可用預設插槽放操作按鈕,也可傳圖片位址替換預設插畫。
空狀態
<template>
<div class="demo-col">
<LhEmpty description="暫無畫作紀錄" />
<LhEmpty>
<template #default>
<LhButton type="primary" @click="reload">重新載入</LhButton>
</template>
</LhEmpty>
<p class="demo-note">未傳 description 時取語言包預設文案;下方為自訂圖片範例。</p>
<LhEmpty
description="自訂圖片位址"
image="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='160'%20height='120'%3E%3Crect%20width='160'%20height='120'%20fill='%23e8e2d5'/%3E%3Cpath%20d='M0%2086%20Q40%2060%2080%2086%20T160%2086%20V120%20H0%20Z'%20fill='%23c9c2b2'/%3E%3Ctext%20x='50%'%20y='50'%20font-size='16'%20fill='%232b4c7c'%20text-anchor='middle'%20font-family='serif'%3E%E6%B0%B4%E5%A2%A8%E7%95%99%E7%99%BD%3C/text%3E%3C/svg%3E"
/>
</div>
</template>
<script>
export default {
methods: {
reload() {
alert('演示:觸發重新載入')
},
},
}
</script>
# Props
| 屬性 | 說明 | 類型 | 預設值 |
|---|---|---|---|
| description | 空狀態描述文案(未傳時取語言包 empty.description) | string | — |
| image | 自訂圖片 URL(替代預設行內插畫) | string | — |
| sx | sx 快速佈局屬性 | — | — |
# Slots
預設插槽:描述下方的操作區(如「重新載入」按鈕)。
Copyright © 2024-2026 风默文学 | 宁ICP备2024006574号 |
苏公网安备32040002010537