diff --git a/knowledge-base/calendar-add-badge-conditionally.md b/knowledge-base/calendar-add-badge-conditionally.md new file mode 100644 index 0000000..2aa9b63 --- /dev/null +++ b/knowledge-base/calendar-add-badge-conditionally.md @@ -0,0 +1,42 @@ +--- +title: Add a badge to the Calendar cells based on a condition +description: An example on how to show a badge based on a condition in the Kendo UI for Vue Calendar. +type: how-to +page_title: Conditionally render a badge - Kendo UI for Vue Calendar +slug: calendar-add-badge-conditionally +tags: calendar, kendo ui for vue, badge, cell, conditionally +res_type: kb +category: knowledge-base +--- + + + + + + + + + + + + +
Product Version4.3.2
ProductProgress® Kendo UI for Vue Native
+ + +## Description + +How can I render a badge for specific calendar cells based on a condition? + +## Solution + +Use the [`cell`](slug:api_dateinputs_calendarprops#toc_cell) prop to render a custom component that will render a [Badge](slug:overview_badge) based on the required condition. + +### Runnable example + +The following example showcases how to render the Badge for the first three dates: + +{% meta id:index height:560 %} +{% embed_file calendar-add-badge-conditionally/main.vue preview %} +{% embed_file calendar-add-badge-conditionally/Cell.vue %} +{% embed_file calendar-add-badge-conditionally/main.js %} +{% endmeta %} diff --git a/knowledge-base/examples/calendar-add-badge-conditionally/Cell.vue b/knowledge-base/examples/calendar-add-badge-conditionally/Cell.vue new file mode 100644 index 0000000..3a33a90 --- /dev/null +++ b/knowledge-base/examples/calendar-add-badge-conditionally/Cell.vue @@ -0,0 +1,58 @@ + + + + + + \ No newline at end of file diff --git a/knowledge-base/examples/calendar-add-badge-conditionally/main.js b/knowledge-base/examples/calendar-add-badge-conditionally/main.js new file mode 100644 index 0000000..be9e20a --- /dev/null +++ b/knowledge-base/examples/calendar-add-badge-conditionally/main.js @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './main.vue' + +createApp(App).mount('#app') diff --git a/knowledge-base/examples/calendar-add-badge-conditionally/main.vue b/knowledge-base/examples/calendar-add-badge-conditionally/main.vue new file mode 100644 index 0000000..3126c40 --- /dev/null +++ b/knowledge-base/examples/calendar-add-badge-conditionally/main.vue @@ -0,0 +1,27 @@ + + + \ No newline at end of file