mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-22 07:06:44 +08:00
Merge branch 'feature/【GFRS-2145】e起陪访' into dev
# Conflicts: # src/assets/js/utils/request.js # src/main.js # src/router/ebiz/index.js
This commit is contained in:
65
src/components/common/PopupSelector.vue
Normal file
65
src/components/common/PopupSelector.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<div>
|
||||
<van-cell-group @click.native="showPopup">
|
||||
<van-field v-bind="$attrs" right-icon="arrow" :value="value" :required="required" :readonly="readonly" />
|
||||
</van-cell-group>
|
||||
<van-popup id="popup" :value="isShow" :position="position" @click-overlay="closePopup">
|
||||
<slot :closePopup="closePopup">
|
||||
<van-picker id="picker" show-toolbar :columns="columns" @confirm="onPickerConfirm" @cancel="closePopup" />
|
||||
</slot>
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'PopupSelector',
|
||||
props: {
|
||||
value: {
|
||||
type: String
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
default: 'bottom'
|
||||
},
|
||||
columns: {
|
||||
type: Array,
|
||||
default() {
|
||||
return ['暂无数据']
|
||||
}
|
||||
},
|
||||
required: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
readonly: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShow: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showPopup() {
|
||||
this.isShow = true
|
||||
},
|
||||
closePopup() {
|
||||
this.isShow = false
|
||||
},
|
||||
onPickerConfirm(pickedValue) {
|
||||
this.$emit('input', String(pickedValue))
|
||||
this.closePopup()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
#app .van-picker__cancel,
|
||||
#app .van-picker__confirm {
|
||||
color: #1989fa;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user