Skip to content

Commit 20efd82

Browse files
fix: use displayName for functional components (#1046)
1 parent e61df6f commit 20efd82

File tree

1 file changed

+3
-0
lines changed
  • packages/devtools-kit/src/core/component/utils

1 file changed

+3
-0
lines changed

packages/devtools-kit/src/core/component/utils/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import type { AppRecord, VueAppInstance } from '../../../types'
22
import { basename, classify } from '@vue/devtools-shared'
33

44
function getComponentTypeName(options: VueAppInstance['type']) {
5+
if (typeof options === 'function') {
6+
return options.displayName || options.name || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || ''
7+
}
58
const name = options.name || options._componentTag || options.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__ || options.__name
69
if (name === 'index' && options.__file?.endsWith('index.vue')) {
710
return ''

0 commit comments

Comments
 (0)