解决 cl-select-date 快捷按钮需点击两次的问题

This commit is contained in:
icssoa
2025-08-20 17:32:26 +08:00
parent 195c2f0316
commit 3200ab2bf8
3 changed files with 11 additions and 4 deletions

View File

@@ -56,7 +56,7 @@
</template>
<script setup lang="ts">
import { forInObject, isDark, parseClass, rpx2px } from "@/cool";
import { forInObject, isDark, isEqual, parseClass, rpx2px } from "@/cool";
import type { ClSelectOption } from "../../types";
import { parseRpx } from "@/cool";
import { computed } from "vue";
@@ -153,6 +153,11 @@ function onChange(e: UniPickerViewChangeEvent) {
// 获取选择器当前选中值数组
const indexs = e.detail.value;
// 相同值不触发事件
if (isEqual(indexs, props.value)) {
return;
}
// 获取所有列的值
const values = props.columns.map((c, i) => {
return c[indexs[i]].value;