更新记录
1.0.0(2023-06-01)
下载此版本
province-selector
使用示例
<province-selector @change="bindPickerChange">
<text class="placeholder_style" v-if="address" style="color: #333;">{{address}}</text>
<text class="placeholder_style" v-else >请选择城市</text>
</province-selector>
import provinceSelector from '@/components/province-selector/province-selector.vue'
export default {
components: {
provinceSelector
},
data() {
return {
address:'',
city_id:0
}
},
methods:{
bindPickerChange(e) {
console.log(e, 'e----')
this.city_id = e.data[1].id
this.address = e.data[0].name + '/' + e.data[1].name
},
}
}
效果图
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
× |
× |
√ |
√ |
√ |
√ |
√ |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
√ |
√ |
√ |
√ |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
province-selector
使用示例
<province-selector @change="bindPickerChange">
<text class="placeholder_style" v-if="address" style="color: #333;">{{address}}</text>
<text class="placeholder_style" v-else >请选择城市</text>
</province-selector>
import provinceSelector from '@/components/province-selector/province-selector.vue'
export default {
components: {
provinceSelector
},
data() {
return {
address:'',
city_id:0
}
},
methods:{
bindPickerChange(e) {
console.log(e, 'e----')
this.city_id = e.data[1].id
this.address = e.data[0].name + '/' + e.data[1].name
},
}
}
效果图