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

[feature request] add autocompletion for props in <template> for imported components #1960

Closed
3 tasks done
Hulkmaster opened this issue Jun 4, 2020 · 6 comments
Closed
3 tasks done
Labels

Comments

@Hulkmaster
Copy link

Hulkmaster commented Jun 4, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Would be nice to have autocompletion feature for props for imported components and add required props by default

some-component.vue

export default {
  props: {
    red: {
      type: Boolean,
      required: true,
    }
  },
}

another-component.vue

<some-component />

here would be nice to have suggestion about possible props, or even better - add required props by default

@yoyo930021
Copy link
Member

It's available now.

@octref octref added the question label Jun 8, 2020
@octref
Copy link
Member

octref commented Jun 8, 2020

If you setup your imports correctly you should get this feature:

image

@octref octref closed this as completed Jun 8, 2020
@Hulkmaster
Copy link
Author

Yeah, sorry, seems like wrong import configuration from my side

@Hulkmaster
Copy link
Author

But then i would still leave second part of my suggestion as a feature request

to mark if component is missing some required properties @octref

@octref
Copy link
Member

octref commented Jun 15, 2020

If that's your cause you should follow #1288.
For the other one see #1571. @ktsn Is it that you looked into this and with Vue 2 typing it's impossible?

@doraeric
Copy link

I need some help, I want to get the autocomplete like the picture above, but I can only see :red like this. What should I do to get red?
I am using nuxt with typescript

// TestComponent.vue
<template>
  <div></div>
</template>

<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
  props: {
    red: Boolean,
  },
})
</script>

crop

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

4 participants