feat(sfc): allow sfcs to recursively self-reference in template via name inferred from filename
e.g. A file named `FooBar.vue` can refer to itself as `<FooBar/>`. This gets rid of the need for the `name` option.
This commit is contained in:
@@ -67,6 +67,12 @@ function resolveAsset(
|
||||
|
||||
// self name has highest priority
|
||||
if (type === COMPONENTS) {
|
||||
// special self referencing call generated by compiler
|
||||
// inferred from SFC filename
|
||||
if (name === `_self`) {
|
||||
return Component
|
||||
}
|
||||
|
||||
const selfName =
|
||||
(Component as FunctionalComponent).displayName || Component.name
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user