Installations
npm install vue-tel-input
Developer
Developer Guide
Module System
ESM
Min. Node Version
Typescript Support
No
Node Version
18.18.2
NPM Version
9.8.1
Statistics
819 Stars
526 Commits
343 Forks
13 Watching
10 Branches
48 Contributors
Updated on 27 Nov 2024
Bundle Size
182.98 kB
Minified
54.39 kB
Minified + Gzipped
Languages
CSS (65.67%)
TypeScript (21.29%)
Vue (11.89%)
JavaScript (1.15%)
Total Downloads
Cumulative downloads
Total Downloads
15,042,243
Last day
-8.7%
21,585
Compared to previous day
Last week
2.2%
116,184
Compared to previous week
Last month
8.4%
486,445
Compared to previous month
Last year
28.1%
4,793,375
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
vue-tel-input
International Telephone Input with Vue.
Documentation and Demo
Vue 2 Support
vue-tel-input@legacy
: Guide
Changelog
Getting started
-
Install the plugin:
1npm install vue-tel-input
-
Add the plugin into your app:
1import Vue from 'vue'; 2import VueTelInput from 'vue-tel-input'; 3import 'vue-tel-input/vue-tel-input.css'; 4 5const app = createApp(App); 6app.use(VueTelInput); 7app.mount('#app');
-
Use the
vue-tel-input
component:1<template> 2 <vue-tel-input v-model="phone"></vue-tel-input> 3</template>
Installation
npm
1 npm install vue-tel-input
Install the plugin into Vue:
1import { createApp } from 'vue'; 2import App from './App.vue'; 3import VueTelInput from 'vue-tel-input'; 4import 'vue-tel-input/vue-tel-input.css'; 5 6const globalOptions = { 7 mode: 'auto', 8}; 9 10const app = createApp(App); 11app.use(VueTelInput, globalOptions); // Define default global options here (optional) 12app.mount('#app');
View all available options in Props.
Or use the component directly:
1<template> 2 <vue-tel-input v-model="phone" mode="international"></vue-tel-input> 3</template> 4 5<script> 6 import { ref } from 'vue'; 7 import { VueTelInput } from 'vue-tel-input'; 8 import 'vue-tel-input/vue-tel-input.css'; 9 10 export default { 11 components: { 12 VueTelInput, 13 }, 14 15 setup() { 16 const phone = ref(null); 17 18 return { 19 value, 20 }; 21 }, 22 }; 23</script>
Browser
1<script src="https://unpkg.com/vue-tel-input"></script> 2<link rel="stylesheet" href="https://unpkg.com/vue-tel-input/dist/vue-tel-input.css" />
If Vue is detected in the Page, the plugin is installed automatically.
** Otherwise, manually install the plugin into Vue:
1app.use(window['vue-tel-input']);
Component lazy loading
Since the library is about 200kb of JavaScript and 100kb of CSS in order to improve initial page loading time you might consider importing it asynchronously only when user navigates to the page where the library is actually needed. The technique is called Lazy Load and you can use it in some modern bundlers like Webpack and Rollup.
1<!-- your-component.vue--> 2<template> 3 <vue-tel-input v-model="value"></vue-tel-input> 4</template> 5<script> 6 const VueTelInput = () => 7 Promise.all([ 8 import(/* webpackChunkName: "chunk-vue-tel-input" */ 'vue-tel-input'), 9 import(/* webpackChunkName: "chunk-vue-tel-input" */ 'vue-tel-input/vue-tel-input.css'), 10 ]).then(([{ VueTelInput }]) => VueTelInput); 11 12 export default { 13 components: { 14 VueTelInput, 15 }, 16 }; 17</script>
As you see, we don't use Vue SFC <style></style>
tag here to import component's css as it would result in CSS going to the main/vendors bundle instead of being downloaded on demand.
Development
Clone the project
1 git clone https://github.com/iamstevendao/vue-tel-input.git
Go to the project directory
1 cd vue-tel-input
Install dependencies
1 npm install
Start the server
1 npm run dev
License
Copyright (c) 2018 Steven Dao. Released under the MIT License.
made with ❤ by Steven.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/deploy.yml:1
- Info: no jobLevel write permissions found
Reason
Found 13/30 approved changesets -- score normalized to 4
Reason
2 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/iamstevendao/vue-tel-input/deploy.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/iamstevendao/vue-tel-input/deploy.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/iamstevendao/vue-tel-input/deploy.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/iamstevendao/vue-tel-input/deploy.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/deploy.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/iamstevendao/vue-tel-input/deploy.yml/main?enable=pin
- Info: 0 out of 5 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 13 are checked with a SAST tool
Reason
11 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-92r3-m2mg-pj97
- Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw
- Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g
- Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
4.1
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to vue-tel-input
@types/vue-tel-input
TypeScript definitions for vue-tel-input
intl-tel-input
A JavaScript plugin for entering and validating international telephone numbers
vue-tel-input-vuetify
International Telephone Input with Vuetify
mui-tel-input
A phone number input designed for the React library MUI built with libphonenumber-js