Skip to content

Commit

Permalink
fix(collapsible): remove slot and emit
Browse files Browse the repository at this point in the history
  • Loading branch information
reynaldi_rangga authored and warsonogits committed Mar 8, 2022
1 parent 17a527a commit e76783c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/VCollapsible/VCollapsibleGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const props = withDefaults(defineProps<Props>(), {
});
const {accordion, items} = toRefs(props);
const emit = defineEmits(['update:modelValue', 'update:items', 'item:change']);
const emit = defineEmits(['update:modelValue', 'update:items', 'item:change', 'onClickItems']);
const groupItems = ref(items.value);
watch(
Expand All @@ -47,19 +47,25 @@ const onChange = (isOpen: boolean, item: CollapsibleItem, idx: number) => {
});
}
};
const onEventItems = (item: CollapsibleItem, idx: number) => {
}
</script>

<template>
<div ref="root">
<slot>
<slot name="header">
<slot name="group:header" >
</slot>
<VCollapsible
v-for="(item, idx) in groupItems"
v-model="item.isOpen"
v-bind="item"
@change="onChange($event, item, idx)"
>
<template #header >
<slot name="item:header" :item="item" :index="idx">
</slot>
</template>
<slot name="items" :row="item" :index="idx">
<slot :name="`item.${idx}`" :item="item">
{{ item.content }}
Expand Down

0 comments on commit e76783c

Please sign in to comment.