How to sync the selected value and selectedTabs according to the route [headlessUI] #1553
Unanswered
jameswong3388
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a project that needs
HeadlessUI
'sListbox
component to handle the page navigation.Currently, I have 2 pages to navigate, a public profile and an account page. When a route is on the public profile I wish to change the
selected
value andselectedTabs
based on the route.For example, when route is on the public profile page, the
selected
value andselectedTabs
should be Public profile.The problem now is that, when a user click on any option, they would be redirect to the page, but since
const selectedTab = ref(tabs[0]);
it always reset theselected
andselectedTab
Beta Was this translation helpful? Give feedback.
All reactions