question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using defineComponent in Vue 2, unknown properties are infered to "any"

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform:macOS
  • Vetur version: 0.30.3
  • VS Code version: 1.51.1

Problem

When using defineComponent from @vue/composition-api, unknown properties do not throw errors in template.

image

import { defineComponent } from '@nuxtjs/composition-api';

export default defineComponent({
     name: 'Test',
     setup(_, {root}) {
     // .....
     }
})

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
victorgarciaesgicommented, Dec 7, 2020

Thanks for the fast fix @yoyo930021! Massive respect for your work on Vetur!

1reaction
yoyo930021commented, Dec 7, 2020

Fixed in @vue/composition-api in new release

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript with Composition API
The type of the props object passed to setup() is inferred from the props option. ts import { defineComponent } ...
Read more >
VueJS 3 Composition API and TypeScript type issue when ...
import { defineComponent, PropType } from 'vue' interface Book ... we make no inferences and the a parameter is given type unknown ....
Read more >
Generically Typed Vue Components with Composition API
Let's start with a simple goal. We need to define a generic component that accepts a value prop that can be of any...
Read more >
TypeScript Support - Vue.js
We can annotate a payload for the emitted event. Also, all non-declared emitted events will throw a type error when called: const Component...
Read more >
vue-tsx-support
TSX (JSX for TypeScript) support library for Vue. Latest version: 3.2.0, last published: a year ago. Start using vue-tsx-support in your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found