美文网首页
vue-count-to Cannot read propert

vue-count-to Cannot read propert

作者: 齐格Insight | 来源:发表于2024-07-31 22:11 被阅读0次

当升级了vue2到vue3后,如果使用了vue-count-to,可能会报:Cannot read properties of undefined (reading '_c')

Cannot read properties of undefined (reading '_c')

这是因为vue-count-to只支持vue2版本

https://github.com/PanJiaChen/vue-countTo

可以看到这个库非常老了。

有以下两种解决方法

文件拷贝

参考
https://blog.csdn.net/m0_50080847/article/details/128203806

升级到 vue3-count-to

参考
https://github.com/xiaofan9/vue-count-to
升级完成后,使用

import countTo from 'vue3-count-to';

https://www.cnblogs.com/architectforest/p/16286639.html

相关文章

网友评论

      本文标题:vue-count-to Cannot read propert

      本文链接:https://www.haomeiwen.com/subject/baonhjtx.html