0.1.14 • Published 2 years ago

@totorobin/vue-auth-directive v0.1.14

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years 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

2 years ago

0.1.11

2 years ago

0.1.12

2 years ago

0.1.13

2 years ago

0.1.14

2 years ago

0.1.2

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.9

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago