williamcruzme / vue-gates

🔒 A Vue.js & Nuxt.js plugin that allows you to use roles and permissions in your components or DOM elements, also compatible as middleware and methods.
https://williamcruzme.github.io/vue-gates/
MIT License
264 stars 31 forks source link

Prevent a nested component from being loaded #51

Open darkons opened 2 years ago

darkons commented 2 years ago

Sorry for a rookie question.

How can I prevent a component from being loaded?

<div v-permission="'list-tasks'">
   <Tasks />
</div>

Although I check if user has "list-tasks" permission, Tasks component still loaded.

Note: I'm using Nuxt

Thank you in advance!