We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using vue-property-decorator for my .vue files:
components/HelloWorld.vue
<script lang="ts"> import { Vue, Options } from "vue-property-decorator"; @Options({}) export default class HelloWorld extends Vue { count = 0; } </script>
App.vue
<script lang="ts"> import { Vue, Options, Ref } from "vue-property-decorator"; import HelloWorld from "./components/HelloWorld.vue"; @Options({ components: { HelloWorld } }) export default class App extends Vue { @Ref() test!: HelloWorld; mounted() { console.log(this.test.count); } } </script>
vue-tsc
src/App.vue:20:10 - error TS2749: 'HelloWorld' refers to a value, but is being used as a type here. Did you mean 'typeof HelloWorld'?
Although VS Code (if volar is not active) successfully auto completed this.test.count. If I change it to typeof HelloWorld i get:
this.test.count
typeof HelloWorld
src/App.vue:20:27 - error TS2339: Property 'count' does not exist on type 'typeof HelloWorld & { __VLS_raw: typeof HelloWorld; __VLS_options: {}; __VLS_slots: {}; }'.
Any chance to get this kind of type safety somehow working?
package.json
"dependencies": { "vue": "^3.0.5", "vue-class-component": "^8.0.0-0", "vue-property-decorator": "^10.0.0-rc.3" }
The text was updated successfully, but these errors were encountered:
This is design limitation, you need to use typeof HelloWorld['__VLS_raw'] for now, see #94.
typeof HelloWorld['__VLS_raw']
Sorry, something went wrong.
No branches or pull requests
I'm using vue-property-decorator for my .vue files:
components/HelloWorld.vue
App.vue
vue-tsc
src/App.vue:20:10 - error TS2749: 'HelloWorld' refers to a value, but is being used as a type here. Did you mean 'typeof HelloWorld'?
Although VS Code (if volar is not active) successfully auto completed
this.test.count
. If I change it totypeof HelloWorld
i get:Any chance to get this kind of type safety somehow working?
package.json
The text was updated successfully, but these errors were encountered: