人数统计

This commit is contained in:
quantulr
2022-10-20 23:46:47 +08:00
parent cb3fdc2ce7
commit 8422f5312e
4 changed files with 73 additions and 26 deletions

View File

@ -1,16 +1,27 @@
<template>
<div class="container flex items-center justify-start">
<img class="icon" src="@/assets/polygon40@3x.png" alt="" />
<div class="title text-white">项目总数</div>
<div class="title text-white">项目总</div>
<div class="counting-board flex justify-between">
<div class="num">1</div>
<div class="num">0</div>
<div class="num">0</div>
<div class="num">0</div>
<div class="num" v-for="item in countChars" :key="item">{{ item }}</div>
</div>
</div>
</template>
<script setup></script>
<script setup>
import { ref, toRefs } from "vue";
const props = defineProps({
data: {
type: Object,
required: true,
},
});
const { data } = toRefs(props);
const countChars = ref([]);
countChars.value = `${parseInt(data.value.PROJECTCOUNT)}`.split("");
for (let i = countChars.value.length; i < 4; i++) {
countChars.value.unshift("0");
}
</script>
<style lang="scss" scoped>
.container {
width: 465px;