Skip to content

Commit

Permalink
fix(vue): extends ComponentOptions with ability member (#73)
Browse files Browse the repository at this point in the history
Allows:

```ts
import { abilitiesPlugin } from '@casl/vue'
import Vue from 'vue';
import ability from './ability'

new Vue({
  router,
  store,
  ability,
  render: (h) => h(App),
}).$mount('#app')
```
  • Loading branch information
bebsworthy authored and stalniy committed Jun 4, 2018
1 parent cadcb73 commit 94d4c24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/casl-vue/index.d.ts
Expand Up @@ -9,3 +9,9 @@ declare module "vue/types/vue" {
$can(action: string, subject: any, field?: string): boolean
}
}

declare module "vue/types/options" {
interface ComponentOptions<V extends Vue> {
ability?: Ability;
}
}

0 comments on commit 94d4c24

Please sign in to comment.