Gathering detailed insights and metrics for vue-tel-input
Gathering detailed insights and metrics for vue-tel-input
Gathering detailed insights and metrics for vue-tel-input
Gathering detailed insights and metrics for vue-tel-input
npm install vue-tel-input
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
819 Stars
526 Commits
343 Forks
13 Watching
10 Branches
48 Contributors
Updated on 27 Nov 2024
Minified
Minified + Gzipped
CSS (65.67%)
TypeScript (21.29%)
Vue (11.89%)
JavaScript (1.15%)
Cumulative downloads
Total Downloads
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
2
International Telephone Input with Vue.
vue-tel-input@legacy
: Guide
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>
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>
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']);
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.
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
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
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
11 existing vulnerabilities detected
Details
Score
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 More@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