Skip to content

Commit

Permalink
#10348:
Browse files Browse the repository at this point in the history
- Adding clarification on how to access `name` property in script setup
  • Loading branch information
incutonez committed Feb 19, 2024
1 parent d3e37ab commit 01094c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 01094c3

Please sign in to comment.