- Edit
- components/HelloWorld.vue to test HMR
-
- Check out - create-vue, the official Vue + Vite starter -
-- Install - Volar - in your IDE for a better DX -
-Click on the Vite and Vue logos to learn more
- - - diff --git a/src/components/Inputs/AutoCompleteInput.vue b/src/components/Inputs/AutoCompleteInput.vue index 22e7fb3..ff0479a 100644 --- a/src/components/Inputs/AutoCompleteInput.vue +++ b/src/components/Inputs/AutoCompleteInput.vue @@ -7,9 +7,12 @@ const props = withDefaults( modelValue: string; options: string[]; alwaysShowSuggestions?: boolean; + disabled?: boolean; + name?: string; }>(), { alwaysShowSuggestions: false, + disabled: false, } ); @@ -23,11 +26,34 @@ const onModelValueChange = (value: string) => { }; const hasFocus = ref(false); +const showSuggestions = ref(false); +let timeOutId = 0; + +const onFocus = () => { + hasFocus.value = true; + showSuggestions.value = true; + + clearTimeout(timeOutId); +}; + +const onBlur = () => { + hasFocus.value = false; + + // Hide the suggestions later to give the click handlers time to react + timeOutId = setTimeout(() => { + showSuggestions.value = false; + }, 100); +}; + +const onButtonClick = (value: string) => { + if (value !== props.modelValue) { + emits("update:modelValue", value); + } +}; const hasMatch = computed{{ price }} euro
+Berekende prijs: {{ price }} euro