Browse Source

mycomponents/button 文件迁移 8/8-10/25

pull/1/head
test 3 months ago
parent
commit
e08be65e79
  1. 40
      src/mycomponents/button/comCheckAll.vue

40
src/mycomponents/button/comCheckAll.vue

@ -0,0 +1,40 @@
<template>
<view class="flex uni-row">
<view class="" >
<u-checkbox size="50" v-model="checkAll" @change="checkAllItems" >
</u-checkbox>
</view>
<view>
<text style="margin-left: 10rpx; font-size: 35rpx;font-weight: bold;">全选({{checkCount}}/{{allCount}})</text>
</view>
</view>
</template>
<script lang="ts" setup>
import {nextTick, ref} from 'vue'
const props = defineProps({
checkCount: {
type: Number,
default: 0
},
allCount: {
type: Number,
default: 0
},
})
const emit = defineEmits(['checkAllItems'])
const checkAll = ref(false)
const checkAllItems = ()=>{
checkAll.value = !checkAll.value
emit('checkAllItems', checkAll.value)
}
const changeCheckAllState = ()=>{
nextTick(()=>{
checkAll.value = props.checkCount == props.allCount
})
}
</script>
<style>
</style>
Loading…
Cancel
Save