You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the name field becomes unpopular in SFC setup syntax, the component's displayed name will always be determined by the file name of the component.
I'm using this kind of file structure in the project.
./TheComponent
-/index.vue
-/index.spec.ts
And the name displayed on the devtool will all become Index, which is not ideal.
The component registered name should have a higher priority to be selected as the component's name on devtool, as we register our component like this.
// setup script importTheComponentfrom'./TheComponent(/index.vue)'// ^^^^^^^^^^^ This name should become the component name.// optional API
...
components: {TheComponent// equals 'TheComponent': TheComponent// ^^^^^^^^^^^^ This name should become the component name.}
...
The text was updated successfully, but these errors were encountered:
Azurewarth0920
changed the title
Optimize the priority of calculating the of the component
Optimize the priority of calculating the displayed name of the component on devtool
Apr 10, 2023
Vue devtools version
6.5.0
Link to minimal reproduction
https://play.vuejs.org/#eNpVjrsKwjAYhV/lN0sUpNklFlxEF1eXLKX5K4HcSNIilL67CZVAxu9cOGclN++7ZUZyITyOQfkEEdPse2GV8S4kuCuNr8Hg00r8whScAdoxVagUaQ2uEHCC7R/ZLWFHZ2MCEz9wLf6RPlBrB28XtDzQk7Cc7bt5MUNC4/WQMBMAb7dZFjmrCXIm9UW531alWvpqc1awbW8/zLdYMA==
Steps to reproduce & screenshots
SFC playground sample.
index.vue
.import FileNameIndex from './index.vue'
Index
is displayed on the devtool.Dev server sample.
./FileNameIndex/index.vue
.import FileNameIndex from './FileNameIndex/index.vue'
vm.$.components
), butIndex
is displayed on the devtool.What is expected?
The registered name should have a higher display priority than the file name.
The name of the component should be displayed as the registered one:
FileNameIndex
What is actually happening?
The file name of the Component is evaluated,
https://github.com/vuejs/devtools/blob/main/packages/app-backend-vue3/src/components/util.ts#L30
before the registered name.
https://github.com/vuejs/devtools/blob/main/packages/app-backend-vue3/src/components/util.ts#L33-L35
System Info
Any additional comments?
As the
name
field becomes unpopular in SFC setup syntax, the component's displayed name will always be determined by the file name of the component.I'm using this kind of file structure in the project.
And the name displayed on the devtool will all become
Index
, which is not ideal.The component registered name should have a higher priority to be selected as the component's name on devtool, as we register our component like this.
The text was updated successfully, but these errors were encountered: