-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Prop types don't work inside the instance when using Vue 2.7 #1537
Labels
Comments
Hi @chearon, this is // test.ts
import {defineComponent} from "vue";
export default defineComponent({
props: {thestring: String},
data: () => ({thenumber: 0}),
created() {
this.thestring; // hover says `any`!
this.thenumber; // hover says `number`
},
}); |
I didn't even think to try that... thank you. For anyone looking, the closest upstream issue is vuejs/vue#12628 |
13 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm having issues with prop types being
any
in this small repro. In a bigger project, they always show asnever
. If I switch to Vue 3, the problem goes away. I tried various things, like using@vue/runtime-dom
, settingvueCompilerOptions.target
, casting withPropType
, and more, but nothing worked, so I think it's really broken. I tried 0.38.2 and 0.36.Component.vue
:jsconfig.json
{ "compilerOptions": { "checkJs": true, "target": "es2020", "module": "es2020", "moduleResolution": "node", "jsx": "preserve" }, "vueCompilerOptions": { "target": 2.7 } }
package.json
{ "dependencies": { "vue": "2.7.2" } }
Volar: show doctor panel
Infostsconfigs
file:///Users/caleb/Code/test-volar/jsconfig.json
Configuration
The text was updated successfully, but these errors were encountered: