BRACKETS-by-TRIAD / craftable-pro-docs

Craftable PRO is an admin panel for your Laravel project build with InertiaJS, Vue and TailwindCSS.
https://docs.craftable.pro
MIT License
7 stars 1 forks source link

Tab Component #104

Open cengizbarul opened 1 month ago

cengizbarul commented 1 month ago

Hello, I use the tab part because I made the view part, but in this part, it returns directly to the homepage with inertiajs, can we add this to the url param?

for ex : http://127.0.0.1:8000/admin/players/view/1

http://127.0.0.1:8000/admin/players/view/1?tab=dashboard http://127.0.0.1:8000/admin/players/view/1?tab=limits etcvs.

strstensky commented 1 month ago

Hello, the Tab component supports the selected prop, so you can select the tab based on a query parameter in your URL. For example, it is used on the Media page, where the current route is checked like this:

<Tab
          :href="route('craftable-pro.media.images')"
          :selected="routeIsActive(route('craftable-pro.media.images'))"
        >
          {{ $t("craftable-pro", "Images") }}
</Tab>

You can check the full file in the vendor folder under resources/js/Pages/Media/Index.vue.