wtt
2026-03-20 410e69559e31fe4a8f2c33e892452582126e5bf3
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
<template>
    <view class="todo-footer">
    <radio-group>
            <!-- <radio /> -->
            <span><span>已完成{{ completedCount }}</span>/总共{{ total }}</span>
            <button @click="clearAllobj">清除已完成</button>
 
    </radio-group>
    </view>
</template>
 
<script>
export default {
    props: {
        todoList: {
            type: Array,
            required: true
        }
    },
    data() {
        return {
            
        }
    },
    computed: {
        completedCount() {
            return this.todoList.filter(item => item.是否选中).length;
        },
        total() {
            return this.todoList.filter(item => item.是否启用).length;
        }
    },
    methods: {
        clearAllobj()
        {
            uni.showModal({
                            title: '提示',
                            content: '确定要清除已完成的事项吗?',
                            success: (res) => {
                                if (res.confirm) {
                                    this.$emit("clearAll");
                                }
                            }
                        });
        }
    }
}
</script>
 
<style>
</style>