Skip to content

Commit 01094c3

Browse files
committed
#10348:
- Adding clarification on how to access `name` property in script setup
1 parent d3e37ab commit 01094c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/api/options-misc.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Explicitly declare a display name for the component.
2929
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.
3030

3131
:::tip
32-
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>`.
32+
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).
3333
:::
3434

3535
## inheritAttrs {#inheritattrs}

Diff for: src/guide/built-ins/keep-alive.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ By default, `<KeepAlive>` will cache any component instance inside. We can custo
7474
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.
7575

7676
:::tip
77-
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.
77+
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).
7878
:::
7979

8080
## Max Cached Instances {#max-cached-instances}

0 commit comments

Comments
 (0)