TypeScript compile error
See original GitHub issueThe .vue
file:
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
@Component({
head: {
title() {
return {
inner: this.title
}
}
},
})
export default class ProductList extends Vue {
title: 'xxx’
}
The error:
Argument of type '{ head: { title(): { inner: any; }; }; }' is not assignable to parameter of type 'VueClass<Vue>'.
Object literal may only specify known properties, and 'head' does not exist in type 'VueClass<Vue>'.
And the error result in the failure of TypeScript compilation.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Detect JavaScript errors during compile time using TypeScript ...
We all know that TypeScript is a language that compile itself to JavaScript. During compile-time TypeScript can emit errors to a terminal, ...
Read more >TypeScript compile error due to typings - Stack Overflow
I'm using typescript 1.7.5, typings 0.6.9 and angular 2.0.0-beta.0. How can I get rid of the typescript compile error messages Duplicate ...
Read more >Understanding TypeScript Errors for Beginners
Another common mistake amongst TypeScript beginners is to assume that because there are no compile-time errors there will be no run-time errors.
Read more >Avoid TypeScript errors in your project by using the TypeScript ...
No more unexpected type errors! ... Avoid TypeScript errors in your project by using the TypeScript compiler.
Read more >TypeScript tool window | WebStorm Documentation - JetBrains
Compile Errors ... The tool window shows up only after you first compile your TypeScript code manually. This can be done in...
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
You can add declaration file youself Example:
types/vue-head/index.d.ts
types/vue-head/options.d.ts
@jamiecarter7
Set generic type of
Component
to your component like@Component<ProjectHome>
to give type information toComponent
declarator