diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue index d2b66bd..073a54a 100644 --- a/src/components/Autocomplete.vue +++ b/src/components/Autocomplete.vue @@ -499,7 +499,7 @@ function getMoreAsyncData() { icon="search" clearable :data="filteredDataBase" - @select="(option: string) => (selectedBase = option)"> + @select="(option: string | number) => (selectedBase = option)"> diff --git a/src/components/Collapse.vue b/src/components/Collapse.vue index 6dcb9b6..95bbb3c 100644 --- a/src/components/Collapse.vue +++ b/src/components/Collapse.vue @@ -36,7 +36,7 @@ const collapses = ref([ " + label="Click me!" />

Subtitle

diff --git a/src/components/Datepicker.vue b/src/components/Datepicker.vue index b97b17e..f6d9a01 100644 --- a/src/components/Datepicker.vue +++ b/src/components/Datepicker.vue @@ -5,8 +5,12 @@ const today = new Date(); const thisMonth = today.getMonth(); const thisYear = today.getFullYear(); const events = [ - new Date(thisYear, thisMonth, 2), - new Date(thisYear, thisMonth, 6), + { + date: new Date(thisYear, thisMonth, 2), + }, + { + date: new Date(thisYear, thisMonth, 6), + }, { date: new Date(thisYear, thisMonth, 6), type: "info", @@ -23,7 +27,9 @@ const events = [ date: new Date(thisYear, thisMonth, 10), type: "link", }, - new Date(thisYear, thisMonth, 12), + { + date: new Date(thisYear, thisMonth, 12), + }, { date: new Date(thisYear, thisMonth, 12), type: "warning", @@ -32,7 +38,9 @@ const events = [ date: new Date(thisYear, thisMonth, 16), type: "danger", }, - new Date(thisYear, thisMonth, 20), + { + date: new Date(thisYear, thisMonth, 20), + }, { date: new Date(thisYear, thisMonth, 29), type: "success", @@ -73,7 +81,7 @@ const selectedString = computed(() => selected.value ? selected.value.toDateString() : "", ); -const date = ref(new Date()); +const date = ref(new Date()); const multiple = ref([]); const range = ref([]); @@ -90,8 +98,11 @@ const maxDate = new Date( const month = ref(); -function selectMonth(option: { name: string; value: number }) { - if (!option || !date.value) return; +function selectMonth(name: string) { + if (!name || !date.value) return; + + const option = months.find((m) => m.name === name); + if (!option) return; date.value.setMonth(option.value); } @@ -238,7 +249,7 @@ const datepickerRef = ref(); :data="months" field="name" expanded - @select="selectMonth" /> + @select="(v) => selectMonth(v as string)" /> @@ -249,7 +260,7 @@ const datepickerRef = ref(); Today - + Clear diff --git a/src/components/Datetimepicker.vue b/src/components/Datetimepicker.vue index e932019..de64267 100644 --- a/src/components/Datetimepicker.vue +++ b/src/components/Datetimepicker.vue @@ -6,10 +6,10 @@ const enableSeconds = ref(false); const hourFormat = ref(); // Browser locale const locale = ref(); // Browser locale -const datetime = ref(new Date()); +const datetime = ref(new Date()); -const minDatetime = ref(null); -const maxDatetime = ref(null); +const minDatetime = ref(); +const maxDatetime = ref();