input正则手机号
时间: 2023-11-07 08:17:12 浏览: 97
根据提供的代码和引用信息,你正在尝试在Vue中使用JavaScript对输入进行手机号正则验证。以下是一个例子,展示了如何使用正则表达式对手机号进行验证:
```javascript
// 在Vue组件中定义一个方法来进行手机号验证
methods: {
test() {
// 获取输入框的值
let str = this.phone.val;
// 正则验证
let p = /^1<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [在vue中input标签手机号码进行正则验证](https://blog.csdn.net/weixin_44986077/article/details/98109043)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [正则验证:手机号码验证](https://blog.csdn.net/L_H_study/article/details/129070490)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [JS input正则验证大全](https://download.csdn.net/download/wuhchengfei616/10590185)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文