首页 > 其他分享 >TypeError: Cannot read properties of undefined (reading '_c') 之 vue3 数字滚动 vue-count-to

TypeError: Cannot read properties of undefined (reading '_c') 之 vue3 数字滚动 vue-count-to

时间:2022-12-06 11:59:27浏览次数:39  
标签:count TypeError num undefined .. title vue components

1.在 node_modules 里找到 vue-count-to 

2. 将 vue-count-to src 文件夹 里的 3 个文件 放到 自己 src components 里 调用 ( 我这里用 count-to 文件包裹起来的)

3. 删除package.json内的 "vue-count-to": "^1.0.13"  ( 在 devDependencies 或者 dependencies 删除 vue-count-to )

使用:

<template>

    <div class="col_center survey" v-for="item in firstDiv" :key="item.title">
        <div>会员数</div>
        <countTo class="fontFam2"   :startVal='0' :endVal='item.num' :duration='2000'></countTo>
    </div>

</template>

<script setup>
import countTo from '../../../components/count-to/index.js'
import { ref } from 'vue'
components: {countTo}

let firstDiv = ref([{title:"会员数",num: 0},{title:"今日新增用户",num: 0},{title:"昨日新增用户",num: 0}])
</script>

期望结果: 未出任何异常  使用正常

 

标签:count,TypeError,num,undefined,..,title,vue,components
From: https://www.cnblogs.com/zhang-hong/p/16954800.html

相关文章

  • CountDownLatch闭锁源码解析(基于jdk11)
    目录CountDownLatch闭锁源码解析(基于jdk11)1.1CountDownLatch概述1.2CountDownLatch原理1.2.1基本结构(jdk11)1.2.2await()方法1.2.3await(timeout,unit)方法1.2.4......
  • Counting Elements - MaxCounters
    YouaregivenNcounters,initiallysetto0,andyouhavetwopossibleoperationsonthem:increase(X) −counterXisincreasedby1,maxcounter −all......
  • mysql,row_count()
    ROW_COUNT()ROW_COUNT() returnsavalueasfollows:DDLstatements:0.Thisappliestostatementssuchas CREATETABLE or DROPTABLE.DMLstatementso......
  • LeetCode: 315. Count of Smaller Numbers After Self
    LeetCode:315.CountofSmallerNumbersAfterSelf题目描述Youaregivenanintegerarraynumsandyouhavetoreturnanewcountsarray.Thecountsarrayhast......
  • mysql 5.7中关于count(*)的优化
    在mysql5.7中,对于selectcount(*)fromtable的优化,可以设置为:selectcount(*)fromtablewhereuid>0其中uid为辅助索引,辅助索引不存放数据......
  • Counting Elements - PermCheck
    QuestionAnon-emptyarrayAconsistingofNintegersisgiven.A permutation isasequencecontainingeachelementfrom1toNonce,andonlyonce.Forexam......
  • Counting Elements - FrogRiverOne
    QuestionAsmallfrogwantstogettotheothersideofariver.Thefrogisinitiallylocatedononebankoftheriver(position0)andwantstogettotheop......
  • Pyrhon初学错误解决:TypeError: Student() takes no arguments
    初学python类方法,报错:TypeError:类对象 Student()takesnoarguments,代码及截图如下:  经排查:类对象Student()的初始化函数init书写错误,两边的下划线为分别为两个下......
  • RNA-seq 详细教程:搞定count归一化(5)
    学习目标了解如何在归一化过程中列出不同的uninterestingfactors(无关因素)了解常用的归一化方法,已经如何使用了解如何创建DESeqDataSet对象及其结构了解如何使用......
  • CountDownLatch详解以及用法示例
    一、什么是countDownlatchCountDownLatch是一个同步工具类,它通过一个计数器来实现的,初始值为线程的数量。每当一个线程完成了自己的任务,计数器的值就相应得减1。当计数器......