File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,19 @@ import { isConstructor } from 'shared/validators'
77import { capitalize , camelize } from 'shared/util'
88
99function vmMatchesName ( vm , name ) {
10- const componentName = vm . $options && vm . $options . name || ''
10+ // We want to mirror how Vue resolves component names in SFCs:
11+ // For example, <test-component />, <TestComponent /> and `<testComponent />
12+ // all resolve to the same component
13+ const componentName = ( vm . $options && vm . $options . name ) || ''
1114 return (
12- ! ! name && (
13- componentName === name ||
15+ ! ! name &&
16+ ( componentName === name ||
17+ // testComponent -> TestComponent
1418 componentName === capitalize ( name ) ||
19+ // testcomponent -> TestComponent
1520 componentName === capitalize ( camelize ( name ) ) ||
16- capitalize ( camelize ( componentName ) ) === name
17- )
21+ // same match as above, but the component name vs query
22+ capitalize ( camelize ( componentName ) ) === name )
1823 )
1924}
2025
You can’t perform that action at this time.
0 commit comments