0👍
If you are using laravel/breeze with inertia
you can access the current authenticated user data using usePage()
or $page
you can use usePage()
if you want to use it inside the <script></script>
tag
const isAdmin = computed(() => {
return usePage().props.auth.user.role === 'Admin'
})
then if you want it inside the template
tag
<div v-if="($page.props.auth.user.role === 'Admin')"></div>
- [Vuejs]-How do a do a scroll in to view for a newly added list item in vueJS
- [Vuejs]-How to sort yaxis label in range bar chart in vue-apexcharts?
Source:stackexchange.com