|
@@ -12,7 +12,7 @@
|
|
<view class="u-dropdown-options">
|
|
<view class="u-dropdown-options">
|
|
<template v-if="list.length">
|
|
<template v-if="list.length">
|
|
<template v-for="(item, index) in list">
|
|
<template v-for="(item, index) in list">
|
|
- <view class="u-dropdown-option" :class="{ 'active': item.active }" @click="clickOption(item, index)">
|
|
|
|
|
|
+ <view class="u-dropdown-option" :class="{ 'active': item.active }" @click="clickOption(item, list, index)">
|
|
<view>{{ item.label }}</view>
|
|
<view>{{ item.label }}</view>
|
|
<van-icon class="van-icon" name="arrow" />
|
|
<van-icon class="van-icon" name="arrow" />
|
|
</view>
|
|
</view>
|
|
@@ -193,9 +193,10 @@
|
|
})
|
|
})
|
|
this.$emit('input', undefined)
|
|
this.$emit('input', undefined)
|
|
},
|
|
},
|
|
- clickOption(item) {
|
|
|
|
|
|
+ clickOption(item, list, index) {
|
|
this.cleanListActive()
|
|
this.cleanListActive()
|
|
this.$set(item, 'active', true)
|
|
this.$set(item, 'active', true)
|
|
|
|
+ this.$set(list, index, item)
|
|
},
|
|
},
|
|
touchStart() {
|
|
touchStart() {
|
|
this.showOptions = !this.showOptions
|
|
this.showOptions = !this.showOptions
|