cardListEnd
Custom component rendered after the last card of every expanded card area. Use it for content that belongs at the bottom of a list, such as an "Add card" button or a list footer.
Usage
cardListEnd?: Component<CardListSlotProps>;
The component receives these props (CardListSlotProps is exported from the package):
| Field | Type | Description |
|---|---|---|
column | ColumnView | The column that owns the card area |
swimlane | SwimlaneView | The swimlane for a swimlane cell or a stack group; absent on an ordinary column |
cards | KanbanCard[] | All filtered and sorted cards in the area, including cards outside the virtual range |
readonly | boolean | The current value of the readonly prop |
cardListEnd follows the same rules as cardListStart:
- The component renders once per expanded card area: in each column, swimlane cell, and stack group. Collapsed areas and exports don't include it.
- It scrolls with the cards and stays mounted when
render.virtualizeColumnshides card content. - It isn't a card. It can't be dragged, it isn't counted, and double-clicking it doesn't add a card.
- A card dropped over it goes to the end of the area.
- The widget doesn't wire any actions. The slot component dispatches them and must respect
readonly.
The rendered wrapper has the wx-card-list-end CSS class.
Example
<script setup>
import { ref, provide } from "vue";
import { Kanban } from "@svar-ui/vue-kanban";
import AddCardButton from "./AddCardButton.vue";
const api = ref(null);
provide("kanban-api", () => api.value);
</script>
<template>
<Kanban ref="api" :cards="cards" :columns="columns" :cardListEnd="AddCardButton" />
</template>
The slot component:
<!-- AddCardButton.vue -->
<script setup>
import { inject } from "vue";
const props = defineProps({
column: { type: Object },
readonly: { type: Boolean },
});
const getApi = inject("kanban-api");
function add() {
getApi()?.exec("add-card", {
card: { label: "New task", column: props.column.id },
});
}
</script>
<template>
<button :disabled="props.readonly" @click="add">+ Add card</button>
</template>