Skip to content

Commit

Permalink
feat(picker): 为当前选中的 picker-roller-item 新增类名 (#3127)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnxysUaen authored Jul 5, 2024
1 parent 21ec9c8 commit c52ab2b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/packages/__VUE/picker/Column.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) }"
>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -318,6 +323,7 @@ export default create({
...toRefs(props),
setRollerStyle,
isHidden,
isCurrPick,
roller,
onTouchStart,
onTouchMove,
Expand Down

0 comments on commit c52ab2b

Please sign in to comment.