diff --git a/src/runtime/components/Accordion.vue b/src/runtime/components/Accordion.vue index 4d8eee90fb..13244d7c31 100644 --- a/src/runtime/components/Accordion.vue +++ b/src/runtime/components/Accordion.vue @@ -22,7 +22,12 @@ export interface AccordionItem { trailingIcon?: IconProps['name'] slot?: string content?: string - /** A unique value for the accordion item. Defaults to the index. */ + /** + * A unique value for the accordion item. Defaults to the index. + * Also used as the Vue `key` for this item, so providing a stable value prevents + * accordion content (and its local state) from remounting when items are added, removed, + * or reordered. + */ value?: string disabled?: boolean class?: any @@ -106,7 +111,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.accordion ||