<template>
	<view><slot></slot></view>
</template>

<script setup>
import { provide, reactive } from 'vue'

const props = defineProps({
	autoClose: {
		type: Boolean,
		default: true
	}
})
const state = reactive({
	children: []
})

const updateChildren = child => {
	state.children.push(child)
}
const toggle = () => {
	if (props.autoClose) {
		state.children.forEach(child => {
			child.updateState()
		})
	}
}

provide('swipeGroup', {
	updateChildren,
	toggle
})
</script>

<style lang="scss" scoped></style>
