File tree 1 file changed +10
-5
lines changed
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'
7
7
import { capitalize , camelize } from 'shared/util'
8
8
9
9
function 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 ) || ''
11
14
return (
12
- ! ! name && (
13
- componentName === name ||
15
+ ! ! name &&
16
+ ( componentName === name ||
17
+ // testComponent -> TestComponent
14
18
componentName === capitalize ( name ) ||
19
+ // testcomponent -> TestComponent
15
20
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 )
18
23
)
19
24
}
20
25
You can’t perform that action at this time.
0 commit comments