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

Recursive component inconsistent behaviour with Vue 2 #1418

Closed
AaronCQL opened this issue Jun 22, 2020 · 0 comments
Closed

Recursive component inconsistent behaviour with Vue 2 #1418

AaronCQL opened this issue Jun 22, 2020 · 0 comments

Comments

@AaronCQL
Copy link

Version

3.0.0-beta.15

Reproduction link

https://github.com/AaronCQL/vue-3-recursive-component

Steps to reproduce

After cloning the repository:

$ npm install
$ npm run serve

Notice that the HelloWorld component renders from 1 to 10 without throwing any errors/warnings.

Now, build and serve the files:

$ npm run build
$ serve ./dist

Notice that the HelloWorld component only renders the first one.

What is expected?

The name option in the HelloWorld component has been deliberately left out. As documented in https://vuejs.org/v2/guide/components-edge-cases.html#Recursive-Components, recursive components should only be able to invoke themselves in their own template with the name option.

Running npm run serve with this same code on Vue 2 will only render the first HelloWorld and throw the warning: Unknown custom element: <hello-world> in the console and suggest about adding the name option.

What is actually happening?

Running npm run serve on this code with Vue 3 does not throw any warnings/errors and actually renders the HelloWorld component 1 through 10 (unlike in Vue 2). The actual built files on the other hand will only render the first HelloWorld component (similar to Vue 2).

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

Successfully merging a pull request may close this issue.

1 participant