File tree 2 files changed +12
-4
lines changed
src/packages/__VUE/elevator
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 16
16
<view class =" nut-elevator__list__item__code" >{{ item[acceptKey] }}</view >
17
17
<view
18
18
class =" nut-elevator__list__item__name"
19
- :class =" { 'nut-elevator__list__item__name--highcolor': currentData.id === subitem.id }"
19
+ :class =" {
20
+ 'nut-elevator__list__item__name--highcolor': currentData.id === subitem.id && currentKey === item[acceptKey]
21
+ }"
20
22
v-for =" subitem in item.list"
21
23
:key =" subitem['id']"
22
24
@click =" handleClickItem(item[acceptKey], subitem)"
@@ -85,7 +87,8 @@ export default create({
85
87
currentIndex: 0 ,
86
88
query: Taro .createSelectorQuery (),
87
89
scrollTop: 0 ,
88
- currentData: {} as ElevatorData
90
+ currentData: {} as ElevatorData ,
91
+ currentKey: ' '
89
92
});
90
93
91
94
const classes = computed (() => {
@@ -171,6 +174,7 @@ export default create({
171
174
const handleClickItem = (key : string , item : ElevatorData ) => {
172
175
context .emit (' click-item' , key , item );
173
176
state .currentData = item ;
177
+ state .currentKey = key ;
174
178
};
175
179
176
180
const handleClickIndex = (key : string ) => {
Original file line number Diff line number Diff line change 5
5
<view class =" nut-elevator__list__item__code" >{{ item[acceptKey] }}</view >
6
6
<view
7
7
class =" nut-elevator__list__item__name"
8
- :class =" { 'nut-elevator__list__item__name--highcolor': currentData.id === subitem.id }"
8
+ :class =" {
9
+ 'nut-elevator__list__item__name--highcolor': currentData.id === subitem.id && currentKey === item[acceptKey]
10
+ }"
9
11
v-for =" subitem in item.list"
10
12
:key =" subitem['id']"
11
13
@click =" handleClickItem(item[acceptKey], subitem)"
@@ -71,7 +73,8 @@ export default create({
71
73
},
72
74
scrollStart: false ,
73
75
currentIndex: 0 ,
74
- currentData: {} as ElevatorData
76
+ currentData: {} as ElevatorData ,
77
+ currentKey: ' '
75
78
});
76
79
77
80
const classes = computed (() => {
@@ -152,6 +155,7 @@ export default create({
152
155
const handleClickItem = (key : string , item : ElevatorData ) => {
153
156
context .emit (' click-item' , key , item );
154
157
state .currentData = item ;
158
+ state .currentKey = key ;
155
159
};
156
160
157
161
const handleClickIndex = (key : string ) => {
You can’t perform that action at this time.
0 commit comments