Skip to content

Empty

Used for displaying empty data state.

Basic Usage

Simply insert content using the default slot.

no data

No data available

暂无数据

<template>
  <div flex>
    <div style="width: 224px; border: 1px solid #eee; height: 150px; margin-right: 20px">
      <b-empty title="no data"></b-empty>
    </div>
    <div style="width: 224px; border: 1px solid #eee; height: 150px; margin-right: 20px">
      <b-empty>No data available</b-empty>
    </div>
    <div style="width: 224px; border: 1px solid #eee; height: 150px">
      <b-empty></b-empty>
    </div>
  </div>
</template>

Directive Usage

Use the v-no-data directive for dynamic assignment, with customizable display text.

<template>
  <div style="width: 224px">
    <div v-no-data:[dataText]="true" style="border: 1px solid #eee; height: 150px"></div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
const dataText = ref('Sorry, no data available at the moment')
</script>

Props

ParameterDescriptionTypeOptionsDefault
titleDisplay textStringis not data

Slot

NameDescription
iconInsert custom icon
defaultDefault slot, can replace text display area