今日分享——vue项目仿淘宝地址智能识别解析实现,省市区街道智能解析。
vue
vuejs/vue: 是一个用于构建用户界面的 JavaScript 框架,具有简洁的语法和丰富的组件库,可以用于开发单页面应用程序和多页面应用程序。
项目地址:https://gitcode.com/gh_mirrors/vu/vue

·
第一步:通过npm安装address-smart-parse第三方库
npm i address-smart-parse --save
第二步:引入使用\
import smart from 'address-smart-parse'
<div class="addressParse">
<el-input
type="textarea"
:rows="6"
v-model="addressParse"
placeholder="智能解析:粘贴或者输入整段文字,自动识别姓名、号码、地址,如:陈某某.
1314***6768广东省广州市天河区xxx街道xxx园区xx号"></el-input>
<el-button class="btn" type="success" @click="addressParseFn" size="mini">识别
</el-button>
</div>
methods:{
//现住址自动识别
addressParseFn() {
if (this.addressParse != '') {
const result = smart(this.addressParse)
console.log(result)
}
}
}
}
console.log(result)数据




vuejs/vue: 是一个用于构建用户界面的 JavaScript 框架,具有简洁的语法和丰富的组件库,可以用于开发单页面应用程序和多页面应用程序。
最近提交(Master分支:17 天前 )
9e887079
[skip ci] 11 个月前
73486cb5
* chore: fix link broken
Signed-off-by: snoppy <michaleli@foxmail.com>
* Update packages/template-compiler/README.md [skip ci]
---------
Signed-off-by: snoppy <michaleli@foxmail.com>
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com> 1 年前
更多推荐
所有评论(0)