fs-swipe-action-group.vue 407 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <view>
  3. <slot></slot>
  4. </view>
  5. </template>
  6. <script setup>
  7. import { provide, reactive } from 'vue'
  8. const state = reactive({
  9. children: []
  10. })
  11. const updateChildren = child => {
  12. state.children.push(child)
  13. }
  14. const toggle = () => {
  15. state.children.forEach(child => {
  16. child.updateState()
  17. })
  18. }
  19. provide('swipeGroup', {
  20. updateChildren,
  21. toggle
  22. })
  23. </script>
  24. <style lang="scss" scoped>
  25. </style>