File tree 1 file changed +5
-4
lines changed
src/components/main/components/tags-nav
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 33
33
ref =" tagsPageOpened"
34
34
:key =" `tag-nav-${index}`"
35
35
:name =" item.name"
36
+ :data-route-item =" item"
36
37
@on-close =" handleClose(item)"
37
38
@click.native =" handleClick(item)"
38
39
:closable =" item.name !== $config.homeName"
@@ -159,11 +160,11 @@ export default {
159
160
this .tagBodyLeft = - (tag .offsetLeft - (outerWidth - this .outerPadding - tag .offsetWidth ))
160
161
}
161
162
},
162
- getTagElementByName (name ) {
163
+ getTagElementByName (route ) {
163
164
this .$nextTick (() => {
164
165
this .refsTag = this .$refs .tagsPageOpened
165
166
this .refsTag .forEach ((item , index ) => {
166
- if (name === item .name ) {
167
+ if (routeEqual (route, item .$attrs [ ' data-route-item ' ]) ) {
167
168
let tag = this .refsTag [index].$el
168
169
this .moveToView (tag)
169
170
}
@@ -185,7 +186,7 @@ export default {
185
186
},
186
187
watch: {
187
188
' $route' (to) {
188
- this .getTagElementByName (to . name )
189
+ this .getTagElementByName (to)
189
190
},
190
191
visible (value ) {
191
192
if (value) {
@@ -197,7 +198,7 @@ export default {
197
198
},
198
199
mounted () {
199
200
setTimeout (() => {
200
- this .getTagElementByName (this .$route . name )
201
+ this .getTagElementByName (this .$route )
201
202
}, 200 )
202
203
}
203
204
}
You can’t perform that action at this time.
0 commit comments