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.
import { defineComponent } from '@nuxtjs/composition-api';
export default defineComponent({
name: 'Test',
setup(_, {root}) {
// .....
}
})
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the fast fix @yoyo930021! Massive respect for your work on Vetur!
Fixed in @vue/composition-api in new release