From e499960a4f186f1a526899ee985ce0b48ba69fac Mon Sep 17 00:00:00 2001
From: lohir <3399054449@qq.com>
Date: 星期二, 22 十月 2024 17:33:40 +0800
Subject: [PATCH] 完成运维考核-工单白名单-列表展示
---
src/views/home/data-view/components/data-icon.vue | 43 ++++++++++++++++++++++++++++++++++++++-----
1 files changed, 38 insertions(+), 5 deletions(-)
diff --git a/src/views/home/data-view/components/data-icon.vue b/src/views/home/data-view/components/data-icon.vue
index c5335fb..4bc3662 100644
--- a/src/views/home/data-view/components/data-icon.vue
+++ b/src/views/home/data-view/components/data-icon.vue
@@ -7,7 +7,7 @@
<i :class="iconList[index].icon" class="icon-font"></i>
</div>
<div class="data-info">
- <div class="data-num">{{ item.value }}</div>
+ <div class="data-num" v-inserted :value="item.value">{{ item.value }}</div>
<div class="data-lable">{{ item.name }}</div>
</div>
</div>
@@ -17,14 +17,15 @@
</template>
<script>
-
+import gsap from 'gsap';
const nameList = {
data1: '宸ュ崟鏁�',
data2: '鎭㈠鏁�',
data3: '寰呮仮澶嶆暟',
- data4: '浜х敓杩濈害浜嬮」鏁�',
- data5: '浜х敓杩濈害璐d换鏁�',
+ data4: '瓒呮湡寰呭鐞嗘暟',
+ data5: '瓒呮湡璐d换鏁�',
}
+
export default {
@@ -72,6 +73,38 @@
immediate: true,
}
},
+ directives: {
+ inserted: {
+ bind(el, binding) {
+ let target = {
+ count: 0
+ };
+ let finalNumber = el.innerText;
+ gsap.to(target, {
+ count: finalNumber,
+ duration: 1,
+ ease: "power2.out",
+ onUpdate: () => {
+ // el.innerText = target.count.toFixed(0);
+ }
+ })
+ },
+ update(el, binding) {
+ let target = {
+ count: el.innerText
+ };
+ let finalNumber = el.getAttribute('value');
+ gsap.to(target, {
+ count: finalNumber,
+ duration: 1,
+ ease: "power2.out",
+ onUpdate: () => {
+ // el.innerText = target.count.toFixed(0);
+ }
+ })
+ }
+ }
+ }
}
</script>
@@ -124,4 +157,4 @@
text-indent: 3px;
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.8.0