表格上方的一行提示:告诉用户当前选了多少条,并提供「清空」链接。
count 为 0 时显示「未选中任何记录」且没有清空链接。
<script setup lang="ts">
import { ref } from 'vue';
import { KSelectedAlert } from '@wujies/components';
const count = ref(3);
</script>
<template>
<div>
<KSelectedAlert :count="count" @clear="count = 0" />
<el-button v-if="count === 0" size="small" @click="count = 5">重新选中 5 条</el-button>
</div>
</template>
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| count | 已选中的条数 | number | 必填 |
| 事件名 | 说明 |
|---|---|
| clear | 点击「清空」 |