2.0.4 • Published 8 months ago

vue3-q-tel-input v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Vue3 Quasar Telephone Input ( VUE3-Q-TEL-INPUT )

The plugin was made over Vue3 while considering the Quasar Framework v2.X. The plugin provides auto country detection on user inputs as well as dropdown for country which supports search by name, country code, and country phone code.

A live preview for the code is available in CodePen

Contributors are welcome.


Version 1

Recommended to upgrade to v2.

For v1 documenation please refer here

Installation

Package manager

yarn

yarn add vue3-q-tel-input

npm

npm i vue3-q-tel-input

Import the component as

import Vue3QTelInput from 'vue3-q-tel-input'

Import the styles as

import 'vue3-q-tel-input/dist/style.css'
CDN / UMD
UNPKG
http://unpkg.com/vue3-q-tel-input@latest/dist/vue3-q-tel-input.umd.js
http://unpkg.com/vue3-q-tel-input@latest/dist/style.css
JSDELIVR
https://cdn.jsdelivr.net/npm/vue3-q-tel-input@latest/dist/vue3-q-tel-input.umd.js
https://cdn.jsdelivr.net/npm/vue3-q-tel-input@latest/dist/style.css

Usage

<vue3-q-tel-input v-model="tel" />

All the props that are supported in the quasar input field are available in the plugin as well.

example

<vue3-q-tel-input v-model="tel" dense outlined />

All the slots that are supported in the quasar input field are available in the plugin as input slots. The country selection element uses append slot.

example

<vue3-q-tel-input>
  <template v-slot:append>
    <q-avatar>
      <img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">
    </q-avatar>
  </template>
</vue3-q-tel-input>

All the slots that are supported in quasar select field are available in the plugin as country select control slots with the prefix cs-.

example

<vue3-q-tel-input>
  <template v-slot:cs-before-options>
    <q-item>
      <q-item-section>
        This renders as before-options q-select slot in the country list
      </q-item-section>
    </q-item>
  </template>
</vue3-q-tel-input>

Model

ModelTypeDescriptionUsageRequired
defaultstringThe telephone valuev-model="telephone_number"
countryCountryThe country object, useful to get it backv-model:country="country"

Props

PropTypeRequiredDescription
requiredBooleanNoShows error validation when the field is empty
search-textStringNoThe label for the search field inside the country dropdown
search-iconStringNoSet the icon for the search field to something else
default-countryStringNoThe default country to load. eg: us, ae, de, in, etc.
dropdown-optionsObejctNoThe props available for the Quasar Select
eager-validateBooleanNoSet to true if the validation needs to be run on loading
use-iconBooleanNoSet to use the emoji icon instead of the default flag images
no-results-textStringNoSet a string when the search results nothing, default: 'No results found'
disable-auto-country-selectionBooleanNoPrevent the input field value from changing the country selection
autofocus-inputBooleanNoFocus automatically to the search input when country selection is opened

Events

EmitterTypeDescription
inputstringTriggers when the input value changes
errorbooleantrue when the input is invalid and false when valid

Credits

  • Project uses REST Countries for generating country list.
  • Thanks to the people who have already contributed to the project
2.0.3

8 months ago

2.0.2

8 months ago

2.0.4

8 months ago

2.0.1

8 months ago

1.1.9

8 months ago

1.1.7

2 years ago

1.1.0

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.51

2 years ago

1.0.53

2 years ago

1.0.44

3 years ago

1.0.22

3 years ago

1.0.26

3 years ago

1.0.47

3 years ago

1.0.25

3 years ago

1.0.46

3 years ago

1.0.24

3 years ago

1.0.45

3 years ago

1.0.23

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.50

2 years ago

1.0.32

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.21

3 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago