Skip to content

Commit 60899f7

Browse files
committed
Merge pull request #282 from gfoidl/accordion-active-item-key
Accordion watches for activeItemKey changes
1 parent 92186d3 commit 60899f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/coreui-vue/src/components/accordion/CAccordion.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, h, provide, ref } from 'vue'
1+
import { defineComponent, h, provide, ref, watch } from 'vue'
22

33
const CAccordion = defineComponent({
44
name: 'CAccordion',
@@ -21,6 +21,9 @@ const CAccordion = defineComponent({
2121
const setActiveItemKey = (key: string | number) => {
2222
activeItemKey.value = key
2323
}
24+
25+
watch(() => props.activeItemKey, value => activeItemKey.value = value)
26+
2427
provide('activeItemKey', activeItemKey)
2528
provide('alwaysOpen', props.alwaysOpen)
2629
provide('setActiveItemKey', setActiveItemKey)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy