fix type errors

This commit is contained in:
Gregor Vostrak
2024-03-11 18:32:54 +01:00
parent a0e729fde5
commit 72f6cb2bdf
3 changed files with 5 additions and 4 deletions

View File

@@ -97,7 +97,7 @@ async function onToggleButtonPress(newState: boolean) {
}
}
const currentProject = ref<Project | null>(null);
const currentProject = ref<Project>();
watch(currentProject, () => {
if (currentProject.value) {
currentTimeEntry.value.project_id = currentProject.value.id;

View File

@@ -20,8 +20,8 @@ import { getRandomColor } from '@/utils/color';
const searchValue = ref('');
const searchInput = ref<HTMLElement | null>(null);
const model = defineModel<Project | null>({
default: null,
const model = defineModel<Project>({
default: undefined,
});
const open = ref(false);
const projectsStore = useProjectsStore();
@@ -63,6 +63,7 @@ async function addProjectIfNoneExists() {
watch(open, (isOpen) => {
if (isOpen) {
nextTick(() => {
// @ts-expect-error We need to access the actual HTML Element to focus as radix-vue does not support any other way right now
searchInput.value?.$el?.focus();
});

View File

@@ -164,7 +164,7 @@ function updateValue(e: string[]) {
<ComboboxRoot
multiple
:open="open"
@update:modelValue="updateValue"
@update:modelValue="updateValue as any"
v-model:searchTerm="searchValue"
class="relative">
<ComboboxAnchor>