【uview】省市二级联动地区选择器

uniapp插件地址

在这里插入图片描述

亲测 兼容微信小程序

使用

注意: 下载安装配置uview组件库,该插件基于uview的upicker组件

  1. 下载插件并导入到项目
  2. 页面中直接引入标签
import barrypicker from '@/uni_modules/barry-picker/components/barry-picker/barry-picker.vue'

components: {
	barrypicker
},
  1. 标签使用
<barry-picker ref="dialog" @get-address="getAddress"></barry-picker>
  1. 方法使用
 // 打开地址弹框
open() {
      this.$refs.dialog.show = true
},
// 获取地址
getAddress(e) {
      console.log('选择的地址是', e);
      this.location = e
}