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

Functional components do not support "components" option #1013

Closed
autumnwoodberry opened this issue Oct 17, 2017 · 5 comments
Closed

Functional components do not support "components" option #1013

autumnwoodberry opened this issue Oct 17, 2017 · 5 comments

Comments

@autumnwoodberry
Copy link

Version

13.3.0

Reproduction link

https://github.com/autumnwoodberry/vue-functional-template-components

Steps to reproduce

created repo using vue-cli webpack template:

  • npm install
  • npm run dev

Look at the "HelloWorld.vue" component definition. The template block has been marked as "functional" and an attempt has been made to import and use an external component:

import TestComp from './TestComp'

export default {
  name: 'HelloWorld',
  components: {
    TestComp
  },
}

What is expected?

Adding a components option to a functional component registers the specified components, which will be available in the functional component's template.

What is actually happening?

The external component is not registered, and is not recognized in the template:

"Unknown custom element: - did you register the component correctly?"


From a post on the forums:

https://forum.vuejs.org/t/how-can-i-use-dynamic-components-inside-vue-js-funcional-components-with-templates/19739/9

@autumnwoodberry
Copy link
Author

This should probably be in vue core.

@gabriel4649
Copy link

@autumnwoodberry Shall I post this on core?

@yyx990803
Copy link
Member

Yeah, this should be feature request in vue core.

@ThomasKotowicz-S1
Copy link

@autumnwoodberry This is possible if you import the component in the parent which is using this functional component.

@privatenumber
Copy link

For reference, the new issue is: vuejs/vue#6872

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

No branches or pull requests

5 participants