0.1.14 • Published 1 year ago

@totorobin/vue-auth-directive v0.1.14

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

VueAuthDirective

This is a vue plugin allowing you to use two directives 'v-auth' and 'v-auth-else' to show component if a habilitation allow it

Example

define the plugin with acess rights levels

const role = ref('admin')
createApp(App).use(authPlugin, {
    accessRights: {
        admin: computed(() => role.value === 'admin'),
    }
}).mount('#app')

then anywhere in your application you can use v-auth directives:

<div v-auth.admin>
   components you can only use if you are an admin
</div>
<div v-auth-else>
   this will not show if you are an admin but will otherwise
</div>
0.1.10

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.2

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago