Skip to content

Commit

Permalink
fix: tab indicator not updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Feb 4, 2024
1 parent 3ca99ad commit 5d42337
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/app-frontend/src/features/ui/components/VueGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ export default defineComponent({
setValue: (value) => (model.value = value),
})
const rootEl = ref<null | HTMLElement>(null)
const root = ref<null | HTMLElement>(null)
const updateIndicator = async () => {
await nextTick()
const el = rootEl.value?.querySelector('.selected') as HTMLElement
const el = root.value?.querySelector('.selected') as HTMLElement
if (!el) {
indicatorStyle.value = null
return
Expand All @@ -92,7 +92,7 @@ export default defineComponent({
height: el.offsetHeight,
}
let parent = el.offsetParent as HTMLElement
while (parent && parent !== rootEl.value) {
while (parent && parent !== root.value) {
offset.top += parent.offsetTop
offset.left += parent.offsetLeft
parent = parent.offsetParent as HTMLElement
Expand Down Expand Up @@ -122,7 +122,7 @@ export default defineComponent({
})
return {
rootEl,
root,
indicatorStyle,
updateIndicator,
}
Expand Down

0 comments on commit 5d42337

Please sign in to comment.