Files
2025-03-05 15:16:45 +08:00

46 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# sx-address-picker
[中国省省市区 数据来源](https://github.com/modood/Administrative-divisions-of-China)
[国家地区来源](https://h5api.m.taobao.com/h5/mtop.cainiao.address.ua.global.area.list/1.0/?jsv=2.5.1&appKey=12574478&t=1712242102859&sign=0a30509ed7f24a5bf58a953d3d908dc2&api=mtop.cainiao.address.ua.global.area.list&v=1.0&dataType=jsonp&type=jsonp&callback=mtopjsonp2&data=%7B%22sn%22%3A%22suibianchuan%22%7D)
# SxAddressPicker 地址选择器
> **组件名sx-address-picker**
### 介绍
该组件高仿淘宝地址省市区区域的picker交互效果效果基本一致。
### 安装方式
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`
### 基本用法
更多示例请下载示例安装查看。该组件依赖官方ui组件uni-icons、uni-list、uni-load-more、uni-popup、uni-transition如果项目本身已导入uni-ui请忽略。
两个json文件在示例包static文件下自己引入或自建cdn
```html
<sx-address-picker v-model="addressPopup" @confirm="addressConfirm"/>
```
## API
### Props
| 属性名 | 类型 | 默认值 | 说明 |
| --------- | -------------- | ------ | ------------------------------- |
| value | Boolean | false | 控制picker是否显示可使用v-model进行控制。 |
| selected | Array | [] | 可选,默认回显的选项。 |
### Events
| 事件称名 | 说明 | 返回参数 |
| -------- | -------------------- | ------------------------------------------------ |
| confirm | 当点击完成选择时发出 | 用户选择完毕/收起菜单触发confirm事件event=[] |
### 名人语录
每个人都会有缺陷,就像被上帝咬过的苹果,有的人缺陷比较大,正是因为上帝特别喜欢他的芬芳。——**托尔斯泰(俄国)**