当前位置: 首页 > news >正文

云建站模板东莞市民服务中心调整入场核验

云建站模板,东莞市民服务中心调整入场核验,前端网页开发,怎么删除wordpress在做后台的时候需要用到地区级联选择器 然后就自己封装了一个 其中 组件页面中 export default {props: { //使用value接收引用页面的绑定值value: [String]},watch: {value: {handler(val) {//val 以及 this.value 都可以获取到引用页面的绑定值},deep: true,immediate: tr…

在做后台的时候需要用到地区级联选择器 然后就自己封装了一个

其中 组件页面中

export default {props: {		//使用value接收引用页面的绑定值value: [String]},watch: {value: {handler(val) {//val 以及 this.value 都可以获取到引用页面的绑定值},deep: true,immediate: true}},
}
//this.$emit("input", this.changeForm()); 这句代码是给引用页面绑定值返回内容

完整地区json文件在网盘中

链接:https://pan.quark.cn/s/0b70e60fd377
提取码:4sSe

下面是完整代码:

引用页面中

<select-address v-model="form.applicableRange"/>

main.js中注册组件

import SelectAddress from '@/components/SelectAddress'Vue.component('SelectAddress', SelectAddress)

组件页面

<template><div class="selectAddress"><el-form :model="form"><el-select v-model="form.provincial" @change="updateProvincials()" clearableplaceholder="请选择省份"><el-option v-for="provincial in provincials" :key="provincial.label" :value="provincial.label":label="provincial.label"/></el-select><el-select v-model="form.municipal" @change="updateMunicipals()"placeholder="请选择城市"><el-option v-for="municipal in municipals" :key="municipal.label" :value="municipal.label":label="municipal.label"/></el-select><el-select v-model="form.regional" @change="updateRegionals()"placeholder="请选择地区"><el-option v-for="regional in regionals" :key="regional.label" :value="regional.label":label="regional.label"/></el-select><el-select v-model="form.streets" @change="updateStreetss()"placeholder="请选择街道"><el-option v-for="streets in streetss" :key="streets.label" :value="streets.label" :label="streets.label"/></el-select></el-form></div>
</template>
<script>
const options = require("@/assets/images/pcas-code.json");
export default {props: {value: [String]},data() {return {form: {provincial: null,municipal: null,regional: null,streets: null,},provincials: options,municipals: [],regionals: [],streetss: [],}},watch: {value: {handler(val) {if (val) {const list = this.value.split(' ');if(list.length == 1){this.form.provincial = list[0];this.updateProvincials();}else if(list.length == 2){this.form.provincial = list[0];this.updateProvincials();this.form.municipal = list[1];this.updateMunicipals();}else if(list.length == 3){this.form.provincial = list[0];this.updateProvincials();this.form.municipal = list[1];this.updateMunicipals();this.form.regional = list[2];this.updateRegionals();}} else {this.reset();return [];}},deep: true,immediate: true}},mounted() {},created() {},computed: {},methods: {reset() {this.form = {provincial: null,municipal: null,regional: null,streets: null}},updateProvincials() {this.form.municipal = "";this.form.regional = "";this.form.streets = "";this.municipals = [];this.regionals = [];this.streetss = [];this.$emit("input", this.changeForm());if(this.form.provincial){this.municipals = this.provincials.find(provincial => provincial.label == this.form.provincial).children;}},updateMunicipals() {this.form.regional = "";this.form.streets = "";this.regionals = [];this.streetss = [];this.$emit("input", this.changeForm());this.regionals = this.municipals.find(municipal => municipal.label == this.form.municipal).children;},updateRegionals() {this.form.streets = "";this.streetss = [];this.$emit("input", this.changeForm());this.streetss = this.regionals.find(regional => regional.label == this.form.regional).children;},updateStreetss() {this.$emit("input", this.changeForm());},changeForm(){let applicableRange = "";if(this.form.provincial){applicableRange = this.form.provincial}if(this.form.provincial && this.form.municipal){applicableRange = this.form.provincial + " " + this.form.municipal}if(this.form.provincial && this.form.municipal && this.form.regional){applicableRange = this.form.provincial + " " + this.form.municipal + " " + this.form.regional}if(this.form.provincial && this.form.municipal && this.form.regional && this.form.streets){applicableRange = this.form.provincial + " " + this.form.municipal + " " + this.form.regional + " " + this.form.streets}return applicableRange;}},
}
</script><style scoped lang="scss">
.el-select {width: 18%;margin-left: 1%;
}
</style>
http://www.yayakq.cn/news/198669/

相关文章:

  • 开发大型网站的流程wordpress 刀具企业
  • 互联网站备案信息信丰做网站
  • 珠海自适应网站设计网上做家教的网站
  • 手袋东莞网站建设重庆网站公司
  • 商城网站建设一般需要多少钱怎么可以让百度快速收录视频
  • 小型电子商务网站规划移动应用开发就业方向
  • 巩义专业网站建设公司推荐wordpress the7汉化版
  • 中国网站建设市场分析报告nike网站策划与建设
  • 建设银行网站安全性分析阿里网站怎样做seo
  • 安卓系统开发软件网站网页优化技巧
  • 东莞市网站建设分站企业wordpress 前台文章
  • 用muse做网站asp网站生成静态
  • 忒低网站长怎么做网站建设贵阳
  • 网站域名登陆南通网页设计培训
  • 成都网站建设中心珠海市网站建设公司
  • 房屋中介做网站的做服务器的网站都有哪些功能
  • 石景山周边网站建设北京中铁建设集团有限公司
  • 网站开发的流程商务网站要怎么做
  • 公司外文网站制作网站地址栏小图标
  • 微信公众号网站制作免费承接网站建设
  • 昆明app制作公司电话怎样健建设一个有利于优化的网站
  • 那个网站域名估价好wordpress时区问题
  • 怎么做网站投放广告的代理商济南做网站公司xywlcn
  • 网站做302重定向会怎么样外贸服装商城网站建设
  • 宿州网站建设开发公司赣州新闻
  • 四川佳和建设工程网站wordpress 用户分组
  • 网站注册页面模板网站seo外包公司
  • 萝岗网站建设百度对wordpress
  • 兰州网站建设100宁波专业网站建设公司
  • 个人怎么做动漫短视频网站手机怎做网站