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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

nuxt-property-decorator + typescript #2567

Closed
3 of 4 tasks
Zenthae opened this issue Dec 14, 2020 · 9 comments
Closed
3 of 4 tasks

nuxt-property-decorator + typescript #2567

Zenthae opened this issue Dec 14, 2020 · 9 comments
Labels

Comments

@Zenthae
Copy link

Zenthae commented Dec 14, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ (lol there is no FAQ.md)
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Win
  • Vetur version: latest 馃槈 (0.31.3)
  • VS Code version: latest 馃槈 (1.52)

Problem

there is no auto-completion / IntelliSense for props and data on custom component using nuxt-property-decorator and typescript

Reproducible Case

@yoyo930021
Copy link
Member

I can't repro it.
Dec-16-2020 21-57-59

@yoyo930021
Copy link
Member

Please provide a repro case.
Please read https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md.

@Zenthae
Copy link
Author

Zenthae commented Dec 17, 2020

i solved the case, it's because i wasn't importing my components since nuxt is doing it by default, so it probably wasn't able to find the definition. but it's sad since it mean that we cannot take advantage of this functionality. is it possible to tell Vetur to look for components directly in a folder ? and not only specifically imported ones ?

@yoyo930021
Copy link
Member

yoyo930021 commented Dec 17, 2020

i solved the case, it's because i wasn't importing my components since nuxt is doing it by default, so it probably wasn't able to find the definition. but it's sad since it mean that we cannot take advantage of this functionality. is it possible to tell Vetur to look for components directly in a folder ? and not only specifically imported ones ?

I am not familiar with nuxt.
but I think you only need this feature.
https://vuejs.github.io/vetur/guide/global-components.html

@Zenthae
Copy link
Author

Zenthae commented Dec 17, 2020

you're my savior ^^
if anyone get the same problem t :

module.exports = {
  projects: [
    {
      root: './',
      globalComponents: [
        // Nuxt components folder
        './components/**/*.vue',
      ],
    },
  ],
};

in vetur.config.js and you need to restart the language server or you editor ^^

@yoyo930021
Copy link
Member

I think your problem is solved.
I close this issue.

@99linesofcode
Copy link

While it may seem that the globalComponents setting solves this issue (it might when you don't nest your components in subdirectories) it doesn't correctly solve the issue here. @nuxt/components allows you to dynamically import components from the components/ directory and any subdirectory there in. As is documented here:

https://nuxtjs.org/docs/directory-structure/components/#nested-directories

I believe this is actually a bug, possibly a very simple one to resolve for anyone familiar with the vetur code base relating to the nuxt external tag loader not being loaded correctly. See my issue for more info #3370

@SimplyCorey
Copy link

Facing the same issue with the next directories and I have not been able to find a solution.

Essentially, we have the following folder setup:

Ui/
     Button.vue

We use @nuxt/components for autoloading (per https://nuxtjs.org/docs/directory-structure/components/#nested-directories )and reference the component in our files as .

The file that vetur generates when viewing vetur doctor has these lines which does not allow vetur to pick up the UiButton component correctly.

{
  "name": "Button",
  "path": "/resources/nuxt/components/block/settings/Button.vue"
},

@jameskid007
Copy link

I've made a plugin to help jump to the corresponding component file. And nested files are supported. The name of the component is 鈥淣uxt 2 goto". You can go to the vscode store to find it

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

No branches or pull requests

5 participants