Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Script Setup Does Not Populate Name Property #2703

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/options-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Explicitly declare a display name for the component.
There is one case where `name` is explicitly necessary: when matching against cacheable components in [`<KeepAlive>`](/guide/built-ins/keep-alive) via its `include / exclude` props.

:::tip
Since version 3.2.34, a single-file component using `<script setup>` will automatically infer its `name` option based on the filename, removing the need to manually declare the name even when used with `<KeepAlive>`.
Since version 3.2.34, a single-file component using `<script setup>` will automatically infer its `name` option based on the filename, removing the need to manually declare the name even when used with `<KeepAlive>`. If you need access to this property, please use [__name](https://github.com/vuejs/core/issues/10348#issuecomment-1951604644).
:::

## inheritAttrs {#inheritattrs}
Expand Down
2 changes: 1 addition & 1 deletion src/guide/built-ins/keep-alive.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ By default, `<KeepAlive>` will cache any component instance inside. We can custo
The match is checked against the component's [`name`](/api/options-misc#name) option, so components that need to be conditionally cached by `KeepAlive` must explicitly declare a `name` option.

:::tip
Since version 3.2.34, a single-file component using `<script setup>` will automatically infer its `name` option based on the filename, removing the need to manually declare the name.
Since version 3.2.34, a single-file component using `<script setup>` will automatically infer its `name` option based on the filename, removing the need to manually declare the name. If you need access to this property, please use [__name](https://github.com/vuejs/core/issues/10348#issuecomment-1951604644).
:::

## Max Cached Instances {#max-cached-instances}
Expand Down