当前位置:网站首页>Use of three-level linkage plug-ins selected by provinces and cities
Use of three-level linkage plug-ins selected by provinces and cities
2022-06-25 10:54:00 【Stranger & love sorrow】
Be careful : This method can only be used in vue In the scaffold project of , If the project has npm install , It is recommended to use npm Way to install
install
npm install
npm install v-distpicker --saveyarn install
yarn add v-distpicker --saveregister
main.js Registering global components
import VDistpicker from 'v-distpicker'
Vue.component('v-distpicker', VDistpicker);In use vue Register in component
import VDistpicker from 'v-distpicker'
export default {
components: { VDistpicker }
}Use
Based on using
<v-distpicker> </v-distpicker>Usage with default values
<v-distpicker province=" Guangdong province, " city=" guangzhou " area=" Haizhu District "> </v-distpicker>
Usage of mobile terminal
<v-distpicker type="mobile"> </v-distpicker>
The specific use
html Code
<template>
<div>
<button @click="choose"> Click my selection area </button>
<p> The city you choose is :<span>{
{txt1}}</span><span>{
{txt2}}</span><span>{
{txt3}}</span></p>
<p class="pwrap" v-if="show">
<v-distpicker type="mobile" @province="onChangeProvince" @city="onChangeCity" @area="onChangeArea"></v-distpicker>
</p>
</div>
</template>
vue Code
<script>
import VDistpicker from 'v-distpicker'
export default {
name: 'getAddress',
components: { VDistpicker },
data() {
return {
show:false,
txt1:'',
txt2:'',
txt3:'',
}
},
methods: {
choose(){
this.show=!this.show
},
onChangeProvince(a){
console.log(a)
this.txt1 = a.value + '-'
},
onChangeCity(a){
console.log(a)
this.txt2 = a.value + '-'
},
onChangeArea(a){
console.log(a)
this.txt3 = a.value
this.show=false
}
},
}
</script>
Corresponding css style
<style scoped>
.pwrap{
height: 400px;
overflow-y: auto;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
}
.pwrap>>>.distpicker-address-wrapper{
color: #999;
}
.pwrap>>>.address-header{
position: fixed;
bottom: 400px;
width: 100%;
background: #000;
color:#fff;
}
.pwrap>>>.address-header ul li{
flex-grow: 1;
text-align: center;
}
.pwrap>>>.address-header .active{
color: #fff;
border-bottom:#666 solid 8px
}
.pwrap>>>.address-container .active{
color: #000;
}
</style>
Final renderings

边栏推荐
- Binder explanation of Android interview notes
- Daily 3 questions (3) - check whether integers and their multiples exist
- 報名開啟|飛槳黑客馬拉松第三期如約而至,久等啦
- 性能之内存篇
- I have summarized the knowledge points of JS [intermediate and advanced] for you
- Five types of questions about network planning
- 【图像融合】基于形态学分析结合稀疏表征实现图像融合附matlab代码
- Google Earth Engine (Gee) - evaluate réalise le téléchargement en un clic de toutes les images individuelles dans la zone d'étude (certaines parties de Shanghai)
- Summary of considerations for native applet development
- 撸一个随机数生成器
猜你喜欢

NETCORE performance troubleshooting

Houdini图文笔记:Your driver settings have been set to force 4x Antialiasing in OpenGL applications问题的解决

Houdini graphic notes: could not create OpenCL device of type (houdini_ocl_devicetype) problem solving
![[paper reading | depth] role based network embedding via structural features reconstruction with degree regulated](/img/70/31a4eaec3f517089b220b35af2f3b7.png)
[paper reading | depth] role based network embedding via structural features reconstruction with degree regulated

Use of Siemens plcs7-200 (I) -- Introduction to development environment and configuration software

【RPC】I/O模型——BIO、NIO、AIO及NIO的Rector模式

网络远程访问的方式使用树莓派

1-7Vmware中的快照与克隆
![[RPC] i/o model - Rector mode of bio, NiO, AIO and NiO](/img/29/1945b130c7c6a575f7a56c51136e3a.jpg)
[RPC] i/o model - Rector mode of bio, NiO, AIO and NiO

TASK03|概率论
随机推荐
视频会议一体机的技术实践和发展趋势
[today in history] June 24: Netease was established; The first consumer electronics exhibition was held; The first webcast in the world
1-7snapshots and clones in VMWare
Yolov5 changing the upper sampling mode
Identityserver4 definition concept
服务端渲染
报名开启|飞桨黑客马拉松第三期如约而至,久等啦
[paper reading | deep reading] drne:deep recursive network embedding with regular equivalence
Flutter adds event listening | subscription
Array structure collation
Remove the problem of orange border on the desktop control in WebView
宏的运用接续符\
Software testing to avoid being dismissed during the probation period
[paper reading | deep reading] line: large scale information network embedding
成长:如何深度思考与学习
中国信通院沈滢:字体开源协议——OFL V1.1介绍及合规要点分析
3 Questions par jour (3) - vérifier l'existence d'entiers et de leurs doubles
Requirements and precautions for applying for multi domain SSL certificate
Garbage collection mechanism
Floating window --- create an activity floating window (can be dragged)