Last active
January 25, 2022 08:59
-
-
Save sadewole/ea4682f08e30dbdcd8b1fff5bc85f9eb to your computer and use it in GitHub Desktop.
AccordionItem.vue - Script: Variables declaration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
... // content hidden | |
type Props = { label: string; defaultIsOpen: boolean }; | |
type Indices = { | |
value: Array<string>; | |
}; | |
type ExpandedIndex = { | |
value: Array<string> | string; | |
}; | |
export default defineComponent({ | |
name: "AccordionItem", | |
... // content hidden | |
setup(props: Props) { | |
const id = ref(useId()); | |
const isExpanded = ref(props.defaultIsOpen || false); | |
const allowMultiple = inject("allowMultiple") as boolean; | |
const indices = inject("indices") as Indices; | |
const expandedIndex = inject("expandedIndex") as ExpandedIndex; | |
} | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment