Browse Source

样式的bug

luxf 4 days ago
parent
commit
c53c0df866
1 changed files with 3 additions and 2 deletions
  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">
 			<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