瀏覽代碼

样式的bug

luxf 4 天之前
父節點
當前提交
c53c0df866
共有 1 個文件被更改,包括 3 次插入2 次删除
  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