Skip to content

Instantly share code, notes, and snippets.

@sadewole
Last active January 25, 2022 08:59
Show Gist options
  • Save sadewole/ea4682f08e30dbdcd8b1fff5bc85f9eb to your computer and use it in GitHub Desktop.
Save sadewole/ea4682f08e30dbdcd8b1fff5bc85f9eb to your computer and use it in GitHub Desktop.
AccordionItem.vue - Script: Variables declaration
<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