当前位置:网站首页>uniapp-picker选择省市区效果demo(整理)
uniapp-picker选择省市区效果demo(整理)
2022-07-19 22:22:00 【我是开心呀】
效果图:
描述:小程序中选择省市区的三级联动功能
picker, 在微信开放文档中小程序的组件-表单组件中就可以看到:
picker主要就是利用其中的mode属性 ,mode属性包含:
<template>
<view class="Box">
<picker mode="region" @change="change">
<view>
我的地址:{
{
myregion}}
</view>
</picker>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
myregion: '请选择',
}
},
// 页面加载
onLoad(e) {
//uni.hideTabBar(); //不让底部显示tab选项
},
// 页面显示
onShow() {
},
// 方法
methods: {
// 点击选择省市区
change(e){
console.log(e,'change');
this.myregion = e.detail.value[0] + '-' + e.detail.value[1] + '-' + e.detail.value[2];
},
},
// 计算属性
computed: {
},
// 侦听器
watch: {
},
// 页面隐藏
onHide() {
},
// 页面卸载
onUnload() {
},
// 触发下拉刷新
onPullDownRefresh() {
this.pageNum = 1
// this.getListData()
},
// 页面上拉触底事件的处理函数
onReachBottom() {
this.pageNum++
// this.getListData()
},
}
</script>
<style lang="scss" scoped>
</style>
边栏推荐
猜你喜欢
牛市还在,资金往头部集中是全球性规律 2021-04-04
什么是Nacos及实战使用教程
leetcode:460. LFU least commonly used cache
教你使用CANN将照片一键转换成卡通风格
【LeetCode每日一题——消失的数字】
多线程进阶篇Step2
Qudian prefabricated dish brand strategy press conference
监听无服务异常处理
Request method ‘POST‘ not supported。 Failed to load resource: net::ERR_ FAILED
第3章业务功能开发(修改市场活动备注)
随机推荐
[cloud based co creation] Huawei cloud helps accelerate the construction of enterprise data assets and data governance production lines
你真的理解持续集成(CI)吗?
牛市当头,目前还能不能买入?2021-04-09
Kubernetes网络插件详解- Flannel篇
超好用的截图软件Snipaste(包含安装包)、如何设置Snipaste开机自启
《opencv学习笔记》-- 阈值化
shell编程(脚本)(变量)
Emergency response > > types and disposal methods of network security emergency events
Makefile implémente les statistiques de temps de compilation
The bull market is still there, and it is a global law for funds to concentrate on the head 2021-04-04
应急响应 >> 网络安全应急事件类型和处置办法
51单片机测量方波信号周期
第3章业务功能开发(修改市场活动备注)
柔性数组
数字化转型迈向深水区:银行业不断夯实科技根基
30 open source software most popular with IT companies
Listen for no service exception handling
云图说丨数字资产链:您的数字资产产权保护神
Typescript正则表达式使用
几种2022年流行的跨端技术方案的比较