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(type-defs): make interface ColorModeInstance extend Vue #62

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

FelixGraf
Copy link
Contributor

When using TypeScript and trying to create a watcher on the value property, the TypeScript compiler complains with:

TS2339: Property '$watch' does not exist on type 'ColorModeInstance'.

Code example:

import { Plugin } from '@nuxt/types'

const colorThemePlugin: Plugin = ({ $colorMode }) => {
  $colorMode.$watch('value', (val: string) => {
    console.log(val)
  })
}

export default colorThemePlugin

Making the interface ColorModeInstance extend Vue, the compiler does not complain.

@codecov
Copy link

codecov bot commented Jan 17, 2021

Codecov Report

Merging #62 (2b42721) into master (1121daf) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #62   +/-   ##
=========================================
  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 1121daf...2b42721. 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