Skip to content

Vue component for hinting addresses using dadata.ru (Vue 3.5+)

License

Notifications You must be signed in to change notification settings

rusproject/vue-dadata

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue Dadata

This is a fork of this Vue component, which provides address suggestions using DaData.ru.

It targets Vue 3.5+.

For Vue 2 and earlier Vue 3 versions (pre-3.5), please refer to Ivan Monastyrev's original repository.

Install

$ pnpm install git+https://github.com/rusproject/vue-dadata.git#rewritten

Usage

<script lang="ts" setup>
import { ref } from 'vue';
import { VueDadata } from 'vue-dadata';
import 'vue-dadata/dist/vue-dadata.css';

const token = import.meta.env.VITE_APP_DADATA_API_KEY as string;

const query = ref('');
const suggestion = ref(undefined);
</script>

<template>
  <div>
    <VueDadata v-model="query" v-model:suggestion="suggestion" :token="token" />
  </div>
</template>

Properties

Prop Required Type Description Default
token Yes string Auth token DaData.ru -
modelValue Yes string v-model for query -
suggestion No object v-model for suggestion undefined
placeholder No string Text placeholder ''
url No string special url for dadata api 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/address'
debounceWait No number waiting time '100ms'
disabled No boolean disabled false
fromBound No string Dadata bound type FROM undefined
toBound No string Dadata bound type TO undefined
inputName No string Input name attribute 'vue-dadata-input'
locationOptions No object Location options for choosing cities or countries undefined
classes No object classes DEFAULT_CLASSES
highlightOptions No object highlight options for vue-word-highlighter DEFAULT_HIGHLIGHT_OPTIONS
selectOnBlur No boolean if true, automatically select suitable suggestion when input loses focus undefined

Peer dependencies

Dependencies

Forked from ikloster03/vue-dadata

About

Vue component for hinting addresses using dadata.ru (Vue 3.5+)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 57.5%
  • Vue 24.9%
  • CSS 8.1%
  • JavaScript 5.9%
  • HTML 3.6%