Vue
Learn how to use Permix with Vue applications
Overview
Permix provides official Vue integration through the permixPlugin
and usePermix
composable. This allows you to manage permissions reactively in your Vue app.
Before getting started with Vue integration, make sure you've completed the initial setup steps in the Quick Start guide.
Setup
First, install the Vue plugin in your application:
Remember to always use the same Permix instance here and in the usePermix
composable to maintain type safety.
Composable
For checking permissions in your components, you can use the usePermix
composable. And to avoid importing the composable and Permix instance in every component, you can create a custom composable:
Components
If you prefer using components, you can import the createComponents
function from permix/vue
and create checking components:
And then you can use the Check
component in your templates: