luxf 4 giorni fa
parent
commit
c53c0df866
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      components/common/u-dropdown-select/index.vue

+ 3 - 2
components/common/u-dropdown-select/index.vue

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