zhangwei
2024-08-14 9d8994790fe403935ed46ad478f83ae110bb7a01
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
    <!--本文件由FirstUI授权予四川政采招投标咨询有限公司(会员ID:1  63,营业执照号:  9 15 101     313 320   06  19 3 K)专用,请尊重知识产权,勿私下传播,违者追究法律责任。-->
    <view>
        <slot></slot>
    </view>
</template>
 
<script>
    export default {
        name: "fui-swipeaction-group",
        data() {
            return {};
        },
        created() {
            this.children = [];
        },
        methods: {
            reset() {
                // wxs 会自己计算组件大小,所以无需执行下面代码
                // #ifndef APP-VUE || H5 || MP-WEIXIN
                this.children.forEach(child => {
                    child.init()
                })
                // #endif
            },
            close() {
                this.children.forEach(child => {
                    // #ifdef APP-VUE || H5 || MP-WEIXIN
                    child.isShow = false;
                    // #endif
 
                    // #ifndef APP-VUE || H5 || MP-WEIXIN
                    child.close()
                    // #endif
                })
            },
            closeAuto(child) {
                // #ifndef APP-VUE || H5 || MP-WEIXIN
                if (this.openItem && this.openItem !== child) {
                    this.openItem.close()
                }
                this.openItem = child
                // #endif
 
                // #ifdef APP-VUE || H5 || MP-WEIXIN
                this.children.forEach(item => {
                    if (item !== child) {
                        item.isShow = false;
                    }
                })
                // #endif
            }
        }
    }
</script>
 
<style scoped></style>