@qubeekio/vue-fio-autocomplete

Simple and lightweight package, that helps with russian fio
14,365
Install
npm install @qubeekio/vue-fio-autocomplete
Latest Version:2.2.3
Vue:2
Last Updated:Jan 11, 2022
Links: npm
Maintainer: shek.maxim

Fio suggestion field

MIT License

Simple and lightweight package, that helps with russian fio

An input field that helps users fill in their full name faster and more correctly. Fully customizable and ready for production, just change styles, and let's rock. It works with dadata.ru or your own custom service.

Usage

Install

$ npm install @qubeekio/vue-fio-autocomplete

Init


import FioAutocomplete from "@qubeekio/vue-fio-autocomplete"

...

methods: {
  async fetch(data) {
    return await axios
      .request({
        method: 'POST',
        url: 'https://suggestions.dadata.ru/suggestions/api/4_1/rs/suggest/fio',
        headers: {
          Authorization: 'Token ' + 'Your token'
        },
        data
      })
      .then(({ data }) => {
        return data.suggestions
      })
  }
}

...

<fio-autocomplete-field
  v-model="fio" 
  :load-using="fetch"
/>

Output value

Field returns user input and splits it into the right parts of fio.

fio: {
  surname: "Иванов",
  name: "Иван",
  patronymic: "Иванович",
  gender: "MALE"
}

Styles

The component includes SCSS.

You can find list of SCSS variables here.

@import "@qubeekio/vue-fio-autocomplete/styles/main.scss";

Estimated response from the server

--

{
  "suggestions": [
    {
      "value": "Виктор",
      "unrestricted_value": "Виктор",
      "data": {
        "surname": null,
        "name": "Виктор",
        "patronymic": null,
        "gender": "MALE",
        "source": null,
        "qc": "0"
      }
    },
  ]
}

License

MIT

Related Packages

vue-google-autocomplete

Vue component to Google Places Autocomplete

1,307,599 502
vuejs-auto-complete

A Vue autocomplete component

187,067 134
vue-use-places-autocomplete

📍 Vue composable for Google Maps Places Autocomplete.

77,332 46
vue-disable-autocomplete

Disable autocomplete on input elements

31,695

Version History

Version Released Vue License
2.2.3 ^2.6.12
2.2.2 ^2.6.12
2.2.1 ^2.6.12
2.2.0 ^2.6.12
2.1.0 ^2.6.12