From c52ab2be9a18eccad9b8480a30d606fb0543a304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=8C=E5=90=91=E6=9E=81=E7=AB=AF?= Date: Fri, 5 Jul 2024 09:45:46 +0800 Subject: [PATCH] =?UTF-8?q?feat(picker):=20=E4=B8=BA=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=9A=84=20picker-roller-item=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=B1=BB=E5=90=8D=20(#3127)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/packages/__VUE/picker/Column.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/packages/__VUE/picker/Column.vue b/src/packages/__VUE/picker/Column.vue index 6953b9ea6e..9764fbcefa 100644 --- a/src/packages/__VUE/picker/Column.vue +++ b/src/packages/__VUE/picker/Column.vue @@ -24,7 +24,8 @@ v-if="item && item[fieldNames.text] && !threeDimensional" class="nut-picker-roller-item-tile" :class="{ - [item[fieldNames.className]]: item[fieldNames.className] + [item[fieldNames.className]]: item[fieldNames.className], + 'nut-picker-roller-item-selected': isCurrPick(index + 1) }" :style="{ height: pxCheck(optionHeight), lineHeight: pxCheck(optionHeight) }" > @@ -217,6 +218,10 @@ export default create({ } } + const isCurrPick = (index: number) => { + return index == state.currIndex + } + const setTransform = (translateY = 0, type: string | null, time = DEFAULT_DURATION, deg: string | number) => { if (type === 'end') { touchTime.value = time @@ -318,6 +323,7 @@ export default create({ ...toRefs(props), setRollerStyle, isHidden, + isCurrPick, roller, onTouchStart, onTouchMove,