Result 结果页
基本使用
Success Tip
Please follow the instructions
Warning Tip
Please follow the instructions
Error Tip
Please follow the instructions
Info Tip
Please follow the instructions
显示代码
html
<template>
<n-result type="success" title="Success Tip" subtitle="Please follow the instructions">
<template #extra>
<n-button type="primary">Back</n-button>
</template>
</n-result>
<n-result type="warning" title="Warning Ti" subtitle="Please follow the instructions">
<template #extra>
<n-button type="primary">Back</n-button>
</template>
</n-result>
<n-result type="danger" title="Error Tip" subtitle="Please follow the instructions">
<template #extra>
<n-button type="primary">Back</n-button>
</template>
</n-result>
<n-result type="info" title="Info Tip" subtitle="Please follow the instructions">
<template #extra>
<n-button type="primary">Back</n-button>
</template>
</n-result>
</template>
自定义内容
Success Tip
404
Please follow the instructions
Sorry, request error
显示代码
html
<template>
<n-result title="Success Tip" subtitle="Please follow the instructions">
<template #icon>
<n-avatar :size="30" src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg" />
</template>
<template #title>
<div>404</div>
</template>
<template #subtitle>
<div>Sorry, request error</div>
</template>
<template #extra>
<n-button type="primary">Back</n-button>
</template>
</n-result>
</template>
API
参数 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
type | 绑定值 | string | ["success","warning","danger","info"] | "success" |
title | 自定义图标名 | string | —— | —— |
subtitle | 自定义图标大小 | string | —— | —— |
Slots
插槽名 | 描述 |
---|---|
icon | 图片插槽 |
title | 标题插槽 |
subtitle | 副标题插槽 |
extra | 内容额外区域的内容 |