Skip to content
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

Intellisense not working in template when not using "script setup" #1298

Closed
enodr opened this issue May 12, 2022 · 2 comments
Closed

Intellisense not working in template when not using "script setup" #1298

enodr opened this issue May 12, 2022 · 2 comments
Labels
question Further information is requested

Comments

@enodr
Copy link

enodr commented May 12, 2022

Hi,

I have noticed that Intellisense is not working in template under two conditions:

  • if the component doesn't have a <script setup></script> part but only <script></script>

with script setup (even if empty):
image

without script setup:
image

  • if the component has a <script setup></script> part but props are defined then Intellisense stops working inside the template:

image

@johnsoncodehk
Copy link
Member

This is expected, Volar intellisense supports base on defineComponent, if you don't have, you can use experimentalImplicitWrapComponentOptionsWithDefineComponent option to tell Volar auto wrap component options by defineComponent.

tsconfig.json / jsconfig.json

{
  "compilerOptions": {
    // ...
  },
  "vueCompilerOptions": {
    "experimentalImplicitWrapComponentOptionsWithDefineComponent": true
  },
  "include": ["src/**/*.js", "src/**/*.ts", "src/**/*.d.ts", "src/**/*.vue"]
}

@johnsoncodehk johnsoncodehk added the question Further information is requested label May 15, 2022
johnsoncodehk added a commit that referenced this issue May 15, 2022
@VincentDream
Copy link

组件中,props不使用defineProps的形式还是会出现这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants