vuetify ip输入_Vuetify国际电话输入
vuetify ip输入
vue电话输入vuetify (vue-tel-input-vuetify)
International Telephone Input with Vuetify.
Vuetify的国际电话输入。
安装 (Installation)
示例存储库 (Example Repository)
You might want to follow and use the basic example usage of this library in this repository Example
你可能想要关注和使用这个库的基本用法示例在这个仓库例
OR try from scratch with below steps
或者按照以下步骤从头开始尝试
Vue-Cli (vue-cli)
create new vue project using
vue-cli
:使用
vue-cli
创建新的vue项目:
vue create my-appcd my-app
证明 (vuetify)
install
vuetify
to newly created vue project将
vuetify
安装到新创建的vue项目
vue add vuetify
npm (npm)
install
vue-tel-input-vuetify
to newly created vue project将
vue-tel-input-vuetify
安装到新创建的vue项目
npm install vue-tel-input-vuetify
Install the plugin into Vue:
将插件安装到Vue中:
With vuetify loader:
使用vuetify loader:
// src/plugins/vuetify.jsimport Vue from 'vue';import Vuetify from 'vuetify/lib';Vue.use(Vuetify);export default new Vuetify({});
// src/VueComponent.jsimport VueTelInputVuetify from "vue-tel-input-vuetify/lib/vue-tel-input-vuetify.vue"<template><vue-tel-input-vuetify></vue-tel-input-vuetify>
</template>export default {components: {VueTelInputVuetify,},
};
// src/main.jsimport Vue from 'vue';
import vuetify from "@/plugins/vuetify";new Vue({vuetify,render: (h) => h(App),
}).$mount("#app");
Without vuetify loader:
没有vuetify加载程序:
// src/plugins/vuetify.jsimport Vue from 'vue';import Vuetify from 'vuetify';import 'vuetify/dist/vuetify.min.css'Vue.use(Vuetify);export default new Vuetify({});
// src/main.jsimport Vue from 'vue';
import VueTelInputVuetify from "vue-tel-input-vuetify";
import vuetify from "./plugins/vuetify";Vue.use(VueTelInputVuetify, {vuetify,
});new Vue({vuetify,render: (h) => h(App),
}).$mount("#app");
View all available options in Props.
在“ 道具”中查看所有可用选项。
Use the vue-tel-input-vuetify
component:
使用vue-tel-input-vuetify
组件:
<template><vue-tel-input-vuetify v-model="phone"></vue-tel-input-vuetify>
<template><script>
export default {data() {return {phone: null}}
};
</script>
用法 (Usage)
道具 (Props)
Property | Type | Default value | Description |
---|---|---|---|
messages
|
String | Array
|
[]
|
Displays a list of messages or message if using a string |
success-messages
|
String | Array
|
[]
|
Puts the input in a success state and passes through custom success messages. |
error-messages
|
String | Array
|
[]
|
Puts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the rules prop. This field will not trigger validation |
hint
|
String
|
undefined
|
Hint text |
suffix
|
String
|
undefined
|
Displays suffix text |
prefix
|
String
|
undefined
|
Displays prefix text |
background-color
|
String
|
undefined
|
Changes the background-color of the input |
rules
|
String
|
Array
|
Accepts an array of functions that take an input value as an argument and return either true / false or a string with an error message |
loader-height
|
Number | String
|
2
|
Specifies the height of the loader |
loading
|
String | Boolean
|
false
|
Displays linear progress bar. Can either be a String which specifies which color is applied to the progress bar (any material color or theme color - primary, secondary, success, info, warning, error) or a Boolean which uses the component color (set by color prop - if it's supported by the component) or the primary color |
hide-details
|
String | Boolean
|
undefined
|
Hides hint and validation errors. When set to auto messages will be rendered only if there's a message (hint, error message, counter value etc) to display |
clearable
|
Boolean
|
false
|
Add input clear functionality, default icon is Material Icons clear |
filled
|
Boolean
|
false
|
Applies the alternate filled input style |
full-width
|
Boolean
|
false
|
Designates input type as full-width |
flat
|
Boolean
|
false
|
Removes elevation (shadow) added to element when using the solo or solo-inverted props |
light
|
Boolean
|
false
|
Applies the light theme variant to the component. |
validate-on-blur
|
Boolean
|
false
|
Delays validation until blur event |
outlined
|
Boolean
|
false
|
Applies the outlined style to the input |
persistent-hint
|
Boolean
|
false
|
Forces hint to always be visible |
readonly
|
Boolean
|
false
|
Puts input in readonly state |
error
|
Boolean
|
false
|
Puts the input in a manual error state |
success
|
Boolean
|
false
|
Puts the input in a manual success state |
shaped
|
Boolean
|
false
|
Round if outlined and increase border-radius if filled. Must be used with either outlined or filled |
single-line
|
Boolean
|
false
|
Label does not move on focus/dirty |
rounded
|
Boolean
|
false
|
Adds a border radius to the input |
value
|
any
|
''
|
The input's value |
label
|
String
|
'Enter a Phone Number'
|
Native input 'label' attribute |
autocomplete
|
String
|
'on'
|
Native input 'autocomplete' attribute |
autofocus
|
Boolean
|
false
|
Native input 'autofocus' attribute |
defaultCountry
|
String
|
''
|
Default country, will override the country fetched from IP address of user |
disabled
|
Boolean
|
false
|
Disable input field |
disabledFetchingCountry
|
Boolean
|
false
|
Disable fetching current country based on IP address of user |
ignoredCountries
|
Array
|
[]
|
List of countries will NOT be shown on the dropdown. ie ['AU', 'BR']
|
inputId
|
String
|
''
|
Custom 'id' for the input
|
inputOptions
|
Object
|
{ showDialCode: false, tabindex: 0 }
|
Options for input, supporting showDialCode (always show dial code in the input) and tabindex
|
maxLen
|
Number
|
25
|
Native input 'maxlength' attribute |
mode
|
String
|
''
|
Format number to 'international' (with + dial code) or 'national' (with 0...)
|
name
|
String
|
'telephone'
|
Native input 'name' attribute |
onlyCountries
|
Array
|
[]
|
List of countries will be shown on the dropdown. ie ['AU', 'BR']
|
placeholder
|
String
|
'Enter a phone number'
|
Placeholder for the input |
preferredCountries
|
Array
|
[]
|
Preferred countries list, will be on top of the dropdown. ie ['AU', 'BR']
|
required
|
Boolean
|
false
|
Required property for HTML5 required attribute |
validCharactersOnly
|
Boolean
|
false
|
Only allow valid characters in a phone number (will also verify in mounted , so phone number with invalid characters will be shown as an empty string)
|
wrapperClasses
|
String | Array | Object
|
''
|
Custom classes for the wrapper |
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
messages
|
String | Array
|
[]
|
显示消息列表或消息(如果使用字符串) |
success-messages
|
String | Array
|
[]
|
将输入置于成功状态,并传递自定义成功消息。 |
error-messages
|
String | Array
|
[]
|
将输入置于错误状态并传递自定义错误消息。 将与规则属性中发生的所有验证结合在一起。 该字段不会触发验证 |
hint
|
String
|
undefined
|
提示文字 |
suffix
|
String
|
undefined
|
显示后缀文字 |
prefix
|
String
|
undefined
|
显示前缀文本 |
background-color
|
String
|
undefined
|
更改输入的背景色 |
rules
|
String
|
Array
|
接受将输入值作为参数的函数数组,并返回true / false或带错误消息的字符串 |
loader-height
|
Number String
|
2
|
指定装载机的高度 |
loading
|
String | Boolean
|
false
|
显示线性进度条。 可以是指定将哪种颜色应用于进度栏的字符串(任何材料颜色或主题颜色-主,辅,成功,信息,警告,错误),也可以是使用组件颜色的布尔值(由颜色属性设置-如果是由组件支持)或原色 |
hide-details
|
String | Boolean
|
undefined
|
隐藏提示和验证错误。 设置为自动时,仅当有消息(提示,错误消息,计数器值等)显示时才会呈现消息 |
clearable
|
Boolean
|
false
|
添加输入清除功能,默认图标为“材料图标”清除 |
filled
|
Boolean
|
false
|
应用替代填充输入样式 |
full-width
|
Boolean
|
false
|
将输入类型指定为全角 |
flat
|
Boolean
|
false
|
当使用独奏或反转的道具时,删除添加到元素的高程(阴影) |
light
|
Boolean
|
false
|
将浅色主题变体应用于组件。 |
validate-on-blur
|
Boolean
|
false
|
延迟验证直到模糊事件 |
outlined
|
Boolean
|
false
|
将轮廓样式应用于输入 |
persistent-hint
|
Boolean
|
false
|
强制提示始终可见 |
readonly
|
Boolean
|
false
|
将输入置于只读状态 |
error
|
Boolean
|
false
|
将输入置于手动错误状态 |
success
|
Boolean
|
false
|
将输入置于手动成功状态 |
shaped
|
Boolean
|
false
|
如果勾勒出圆角,则填满,增加边界半径。 必须与概述或填充一起使用 |
single-line
|
Boolean
|
false
|
标签没有移到焦点/脏处 |
rounded
|
Boolean
|
false
|
将边界半径添加到输入 |
value
|
any
|
''
|
输入值 |
label
|
String
|
'Enter a Phone Number'
|
本机输入“标签”属性 |
autocomplete
|
String
|
'on'
|
本机输入“自动完成”属性 |
autofocus
|
Boolean
|
false
|
本机输入“自动对焦”属性 |
defaultCountry
|
String
|
''
|
默认国家/地区,将覆盖从用户IP地址获取的国家/地区 |
disabled
|
Boolean
|
false
|
禁用输入字段 |
disabledFetchingCountry
|
Boolean
|
false
|
禁用基于用户的IP地址获取当前国家/地区 |
ignoredCountries
|
Array
|
[]
|
国家列表将不会显示在下拉列表中。 即['AU', 'BR']
|
inputId
|
String
|
''
|
input 自定义“ id”
|
inputOptions
|
Object
|
{ showDialCode: false, tabindex: 0 }
|
输入选项,支持showDialCode (始终在输入中显示拨号代码)和tabindex
|
maxLen
|
Number
|
25
|
本机输入'maxlength'属性 |
mode
|
String
|
''
|
将数字格式设置为'international' (带+拨号代码)或'national' (带0 ...)
|
name
|
String
|
'telephone'
|
本机输入“名称”属性 |
onlyCountries
|
Array
|
[]
|
国家列表将显示在下拉列表中。 即['AU', 'BR']
|
placeholder
|
String
|
'Enter a phone number'
|
输入的占位符 |
preferredCountries
|
Array
|
[]
|
首选国家/地区列表将位于下拉列表的顶部。 即['AU', 'BR']
|
required
|
Boolean
|
false
|
HTML5必需属性的必需属性 |
validCharactersOnly
|
Boolean
|
false
|
仅允许电话号码中包含有效字符(也将在已mounted 验证,因此电话号码中包含无效字符的情况将显示为空字符串)
|
wrapperClasses
|
String | Array | Object
|
''
|
包装器的自定义类 |
大事记 (Events)
Event | Arguments | Description | Notes |
---|---|---|---|
input
|
String , Object
|
Fires when the input changes with the argument is the object includes { number, isValid, country }
|
onInput deprecated
|
validate
|
Object
|
Fires when the correctness of the phone number changes (from true to false or vice-versa) and when the component is mounted { number, isValid, country }
|
onValidate deprecated
|
blur
|
Fires on blur event |
onBlur deprecated
|
|
space
|
Fires on keyup.space event |
onSpace deprecated
|
|
enter
|
Fires on keyup.enter event |
onEnter deprecated
|
|
open
|
Fires when the flags dropdown opens | ||
close
|
Fires when the flags dropdown closes | ||
country-changed
|
Object
|
Fires when country changed (even for the first time) |
事件 | 争论 | 描述 | 笔记 |
---|---|---|---|
input
|
String Object
|
当输入随参数更改为对象包括{ number, isValid, country } 时触发
|
不推荐使用onInput
|
validate
|
Object
|
当电话号码的正确性更改(从“ true 到“ false 或从“ true 到“ false ,反之亦然)并且安装了组件{ number, isValid, country } 时触发
|
不推荐使用onValidate
|
blur
|
在模糊事件上触发 |
不推荐使用onBlur
|
|
space
|
在keyup.space事件上触发 |
不onSpace 使用onSpace
|
|
enter
|
在keyup.enter事件上触发 |
onEnter 已弃用
|
|
open
|
当标志下拉列表打开时触发 | ||
close
|
当标志下拉列表关闭时触发 | ||
country-changed
|
Object
|
国家变更(即使是第一次)时触发 |
翻译自: https://vuejsexamples.com/international-telephone-input-with-vuetify/
vuetify ip输入
vuetify ip输入_Vuetify国际电话输入相关推荐
- 国际电话组件封装使用以及vuephonenumberinput属性解读
phone-number-input 组件描述:国际电话输入组件. 适用场景:电话号码输入框. 特点: 包含各个国家的区号: 输入一串号码,可给出是否是正确号码的校验结果: 灵活性.可变性强:可满足绝 ...
- Java黑皮书课后题第4章:*4.15(电话键盘)电话上的国际标准字母/数字映射如下所示。编写程序,提示用户输入一个小写或大写字母,然后显示对应数字。对于非字母输入,提示非法输入
*4.15(电话键盘)电话上的国际标准字母/数字映射如下所示.编写程序,提示用户输入一个小写或大写字母,然后显示对应数字.对于非字母输入,提示非法输入 题目 题目概述 运行示例 破题 代码 题目 题目 ...
- 怎么知道本台计算机的用户名和密码,访问其它电脑时“开始-运行-\输入要连接的电脑的IP,用户名和密码输入什么?...
访问其它电脑时"开始-运行-\输入要连接的电脑的IP",用户名和密码输入什么?以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让 ...
- 一个IP地址是由四个字节(每个字节8个位)的二进制码组成。请将32位二进制码表示的IP地址转换为十进制格式表示的IP地址输出。如果输入的数字不足32位或超过32位或输入的数字中有非0和1的数字时输出“
题目 一个IP地址是由四个字节(每个字节8个位)的二进制码组成.请将32位二进制码表示的IP地址转换为十进制格式表示的IP地址输出.如果输入的数字不足32位或超过32位或输入的数字中有非0和1的数 ...
- C++ OJ 中多行数据输入(大小写转换、通过移位运算实现2的n次方、多组输入,每行输入数量不一样)
1. 多组输入,输出每行最大值 while(cin>>a>>b) 主要解决的是两个为一组的多组数据输入,当一次只输入一个数据时就用 while(cin>>a) 输入 ...
- tkinter实现弹出输入对话框并获取输入对话框中的值
方法一: import os import cv2 import tkinter from CBC_2 import CBCS from Base64 import BaSe64 from CBC_1 ...
- 1、存在如下数列1、1、2、4、7、13、24、44、81、149......现要求该数列第n项的值(n从O开始算)。 程序运行结果: 1/2 输入:4 输出:7 输入:9 输出:149
** 题目 ** /* 1.存在如下数列1.1.2.4.7.13.24.44.81.149-现要求该数列第n项的值(n从O开始算). 程序运行结果: 1/2 输入:4 输出:7 输入:9 输出:149 ...
- Java编程笔试时输入问题:如何输入固定长度、不定长度的一维数组?如何输入固定长度、不定长度的二维数组?
Java编程笔试时输入问题: 如何输入固定长度.不定长度的一维数组? 如何输入固定长度.不定长度的二维数组? 如何将数组中的内容直接输出,不要中括号和逗号? 文章目录 ==Java编程笔试时输入问题= ...
- Keras: 多输入及混合数据输入的神经网络模型
目录 摘要 正文 什么是混合数据? Keras如何接受多个输入? 房价数据集 获取房价数据集 项目结构 加载数值和分类数据 加载图像数据集 定义多层感知器(MLP)和卷积神经网络(CNN) 使用Ker ...
最新文章
- 从源码分析DEARGUI之add_progress_bar
- JVM的内存结构,Eden和Survivor比例;JVM中一次完整的GC流程,对象如何晋升到老年代,说说你知道的几种主要的JVM参数;CMS 常见参数解析;.你知道哪几种垃圾收集器,各自的优缺点
- wave文件 fft_STM32F103 如何实现 FFT?
- 深度学习(图像处理)代码库
- 三分钟小课堂-----------------docker(三)增删改查命令
- node.js中的文件系统
- 垃圾邮件是什么样的邮件
- 同人游戏开发工具巡礼——AVG ADV 引擎篇
- cad打开卡死_CAD一打开就卡死,重装也不管用怎么办?
- 详细“企业库”编写流程
- SQL中进行去重的方法
- 谷歌身份验证器验证码不对怎么回事_兼容谷歌验证器,开源的动态验证码小程序了解一下
- Unity获取系统信息SystemInfo(CPU、显卡、操作系统等信息)
- 【Echarts】Echarts给title添加背景图片
- ERFNet网络的演化
- 关于前端frame框架
- 无法给变量添加属性导致出问题
- Redis中存字段key出现 \xef \xbb \xbf
- 使用ONE(一个)API为博客添加每日一句话
- tailf_查看远程