Skip to content

erm2000/dawa-quasar-vue3-autocomplete

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

dawa-quasar-vue3-autocomplete

Dawa has an API to get all valid addresses in Denmark.

(ref: https://dawadocs.dataforsyningen.dk/dok/api/autocomplete#autocomplete)

So this component makes it possible to "autocomplete" a input field; into a valid DK address, by making requests to Dawa's API while typing

Component for a Dawa autocomplete are using Vue 3 Typescript/Composition API with Quasar

It's not really a downloadable project; but more like a copy/paste project

I hope someone might find this useful

Usage:

<script setup lang="ts">
import { ref, watch } from 'vue'
import { IDawaSearchObject } from 'src/components/models'
import DawaAddress from 'src/components/DawaAddressComponent.vue'
  
const dawaAddressInput = ref<IDawaSearchObject>( { isSelectedAddress: false, searchaddress: '' } )

watch(
  () => dawaAddressInput,
  async (newValue, oldValue) => {
    if (newValue.isSelectedAddress) {
      console.log('Watch - dawaAddress changed')
    }
  }
)
</script>

<template>
  <q-form class="q-px-sm">
      <DawaAddress v-model="dawaAddressInput" color="secondary"/>
  </q-form>
</template>

About

Component for a Dawa autocomplete using Vue 3 Typescript/Composition API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published