Commit 28eed243 authored by Damon's avatar Damon

下拉组件修改

parent 4daae323
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="xh-select"> <view class="xh-select">
<u-input :value="text" readOnly @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle" <u-input :value="text" readOnly @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"></u-input> :custom-style="customStyle" :clearable="false"></u-input>
<u-action-sheet :list="settings" v-model="show" @click="actionSheetCallback" safe-area-inset-bottom></u-action-sheet> <u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select>
<u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon>
</view> </view>
...@@ -43,8 +43,8 @@ ...@@ -43,8 +43,8 @@
let settings = this.item.fieldsOptions || [] let settings = this.item.fieldsOptions || []
result = settings.map(item => { result = settings.map(item => {
return { return {
text: item.label, label: item.label,
id: item.key, value: item.key,
color: '#333333', color: '#333333',
fontSize: 26 fontSize: 26
} }
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
actionSheetCallback(index) { actionSheetCallback(event) {
let id = this.settings[index].id; const id = event[0].value
this.dataValue = id this.dataValue = id
this.valueChange(id) this.valueChange(id)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment