-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Component Name shown as "Anonymous Component" #1311
Comments
try to use named component. |
Same problem, the name has been declared when registering the component |
app.component("comment", {
name: 'comment', // component name declared in here.
props: {
comment: {
type: Object,
required: true
}
},
template: `
<div>
<div class="card-body">
<strong><p>{{ comment.username }}</p></strong>
<p>{{ comment.content }}</p>
</div>
<hr>
</div>
`
}); |
Hi both, and thanks for your answers. @TimRChen , am I missing something in v3? Shouldn't this be optional at best, as the name is already declared as the first argument to app.component ? https://v3.vuejs.org/guide/component-registration.html#component-names |
That's the point
The original words in the document https://v3.vuejs.org/api/application-api.html#component |
Hi, there. I found this method: https://github.com/vuejs/vue-devtools/blob/6d8fee4d058716fe72825c9ae22cf831ef8f5172/packages/shared-utils/src/util.js#L260-L269 |
@TimRChen So if registration automatically sets the components name why does it need an additional name property to show up in dev tools as something other than Anonymous Component? Why doesn't dev tools show the name that the component was automatically given? |
I don't know. but you can find answer in source code. |
Please provide a runnable reproduction. |
I'm getting this issue with the |
I got this issue when using vue-styled-components. fixed it like this
|
I got this problem with the The fix is to register this component with a name in main.ts: import { createApp } from 'vue'
import { Icon } from '@iconify/vue'
import App from './App.vue'
createApp(App).component('icon', Icon) |
这是一封自动回复邮件。已经收到您的来信,我会尽快回复。
|
6.0.0-beta.2
Browser and OS info
Chromium Version 86.0.4240.111 (Official Build) Arch Linux (64-bit)
Steps to reproduce
Create Basic Vue 3 App and Component:
What is expected?
I expect to see the component name (comment) in Vue Devtools. under Root
What is actually happening?
Vue Devtools returns "Anonymous Component" for each component instance
The text was updated successfully, but these errors were encountered: