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

fix: types compatible with nuxt-property-decorator #72

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

Kolahzary
Copy link
Contributor

No more type errors for forced color mode on nuxt-property-decorator

import { Component } from 'nuxt-property-decorator'
import Vue from 'vue'
@Component({
  colorMode: 'light',
  ...
})
export default class LightModeForcedPage extends Vue {
 ...
}

Given error before this fix:

 Overload 1 of 2, '(options: ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>> & ThisType<...>): <VC extends VueClass<...>>(target: VC) => VC', gave the following error.
    Argument of type '{ colorMode: string; layout: string; components: { ValidationObserver: ExtendedVue<Vue & { $_veeObserver: VeeObserver; $vnode: VNodeWithVeeContext; }, { ...; }, { ...; }, unknown, { ...; }>; ValidationProvider: ExtendedVue<...>; DatePicker: any; }; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>> & ThisType<...>'.
      Object literal may only specify known properties, and 'colorMode' does not exist in type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>> & ThisType<...>'.

No more type errors for forced color mode on nuxt-property-decorator
```
import { Component } from 'nuxt-property-decorator'
import Vue from 'vue'
@component({
  colorMode: 'light',
  ...
})
export default class LightModeForcedPage extends Vue {
 ...
}
```

Given error before this fix:
```
 Overload 1 of 2, '(options: ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>> & ThisType<...>): <VC extends VueClass<...>>(target: VC) => VC', gave the following error.
    Argument of type '{ colorMode: string; layout: string; components: { ValidationObserver: ExtendedVue<Vue & { $_veeObserver: VeeObserver; $vnode: VNodeWithVeeContext; }, { ...; }, { ...; }, unknown, { ...; }>; ValidationProvider: ExtendedVue<...>; DatePicker: any; }; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>> & ThisType<...>'.
      Object literal may only specify known properties, and 'colorMode' does not exist in type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<Record<string, any>>, Record<...>> & ThisType<...>'.
```
@codecov
Copy link

codecov bot commented Feb 23, 2021

Codecov Report

Merging #72 (8db84ee) into master (7234033) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #72   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           19        19           
  Branches         2         2           
=========================================
  Hits            19        19           

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 7234033...da59969. Read the comment docs.

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.

2 participants