Skip to content
On this page

Result 结果页

基本使用

显示代码
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内容额外区域的内容