
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
vue-intl-telephone-input
Advanced tools
Vue component for input international telephone numbers and validating.
Vue component for input international telephone numbers and validating.
yarn add vue-intl-telephone-input
npm i --save vue-intl-telephone-input
Install as a global component:
import IntlTelInput from 'vue-intl-telephone-input';
Vue.component('intl-tel-input', IntlTelInput);
In your page component:
<template>
...
<intl-tel-input :countryCode="'tw'" @validateSuccess="onSuccess"></intl-tel-input>
...
<template>
<script>
export default {
data() {
return {
phone: '',
};
},
methods: {
/**
* @param {string} number
* @param {string} countryCode
*/
onSuccess({ number, countryCode }) {
console.log(number, countryCode);
}
},
}
</script>
Import in single component:
<template>
<intl-tel-input :countryCode="'tw'"></intl-tel-input>
</template>
<script>
import IntlTelInput from 'vue-intl-telephone-input';
export default {
name: 'Home',
components: {
IntlTelInput,
}
};
</script>
| Property value | Type | Default value | Description |
|---|---|---|---|
countryCode | String | 'tw' | Default country. ex: 'tw', 'jp', 'kr' |
dialCode | String | '' | Enter a country dial code. ex: '886', '81', '82' |
value | String | '' | Enter a phone number |
options | Object | {} | Custom Options |
options.className | String | '' | Set custom css class name |
options.input | Object | Set input attribute | |
options.input.required | Boolean | false | Required property for HTML5 required attribute |
options.input.readonly | Boolean | false | Set readonly attribute |
options.input.placeholder | String | '' | Set placeholder attribute |
| 參數 | 型態 | 預設值 | 描述 |
|---|---|---|---|
countryCode | String | 'tw' | 預設國家代碼 ex: 'tw', 'jp', 'kr' |
dialCode | String | '' | 國際碼 ex: '886', '81', '82' |
value | String | '' | 電話號碼 |
options | Object | {} | 客制選項 |
options.className | String | '' | 設置客制 css class 名稱 |
options.input | Object | 設定 input 的屬性 | |
options.input.required | Boolean | false | 是否為必填 |
options.input.readonly | Boolean | false | 是否為不能更改 |
options.input.placeholder | String | '' | 設定預設顯示字串 |
| Property value | Arguments | Description |
|---|---|---|
validateSuccess | Object | Fires when the input changes on validate success with the argument is the object includes { number, countryCode } |
validateError | Fires when the input changes on validate error |
| 事件名稱 | 參數型別 | 描述 |
|---|---|---|
validateSuccess | Object | 電話格式正確時觸發,會回傳 { number, countryCode } |
validateError | 電話格式錯誤時觸發,不會回傳任何參數 |
you can set options.className :
<template>
...
<intl-tel-input :options="otipns"></intl-tel-input>
...
<template>
<script>
export default {
data() {
return {
otipns: {
className: 'my-style'
}
};
}
}
</script>
<style>
.intl-tel-input.my-style .conutry-list .category-box .category-box-header {
background-color: #3f51b5;
}
</style>
FAQs
Vue component for input international telephone numbers and validating.
We found that vue-intl-telephone-input demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.