Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extends ComponentOptions with ability member #73

Merged
merged 1 commit into from
Jun 4, 2018

Conversation

bebsworthy
Copy link
Contributor

This fix a typescript error when following the tutorial:

Code:

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

new Vue({
  router,
  store,
  ability,
  render: (h) => h(App),
}).$mount('#app')

Error:

[ts]
Argument of type '{ router: VueRouter; store: Store<{}>; ability: Ability; render: (h: CreateElement) => VNode; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Rec...'.
  Object literal may only specify known properties, and 'ability' does not exist in type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Rec...'.

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')
```
@codecov-io
Copy link

codecov-io commented Jun 4, 2018

Codecov Report

Merging #73 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #73   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files          16       16           
  Lines         284      284           
=======================================
  Hits          283      283           
  Misses          1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cadcb73...f49dc80. Read the comment docs.

@stalniy
Copy link
Owner

stalniy commented Jun 4, 2018

Awesome :) Thanks for contribution!

@stalniy stalniy merged commit 90e2fb3 into stalniy:master Jun 4, 2018
stalniy pushed a commit that referenced this pull request Jun 4, 2018
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')
```
@stalniy
Copy link
Owner

stalniy commented Jun 4, 2018

published @casl/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants