feat(Accordion): add multiple prop and close others by default (#364)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Dominik Opyd
2023-07-03 14:38:13 +02:00
committed by GitHub
parent e0f1798f07
commit b78fcf91a4
3 changed files with 106 additions and 34 deletions

View File

@@ -0,0 +1,22 @@
import { watch, defineComponent } from 'vue'
export default defineComponent({
props: {
open: {
type: Boolean,
default: false
}
},
emits: ['open', 'close'],
setup (props, { emit }) {
watch(() => props.open, (value) => {
if (value) {
emit('open')
} else {
emit('close')
}
})
return () => {}
}
})