Skip to content

Function: createCanDirective() ​

ts
function createCanDirective(rbac): Directive<HTMLElement, NameList>;

Defined in: packages/vue/src/directives.ts:51

v-can="'edit articles'" — single permission. v-can="['a', 'b']" / v-can.all="[...]" — all of them. v-can.any="[...]" — any of them. v-can.not="'x'" — shown only when the user does NOT have it.

Parameters ​

ParameterType
rbacVueRbac

Returns ​

Directive<HTMLElement, NameList>

Released under the MIT License. Inspired by spatie/laravel-permission.