格式化时间函数调用
来源:5-5 -使用Copilot一分钟生成一个formatDate时间格式化函数

一逐星一
2023-08-01
<div class="time">{{ formatDate(blog.updateTime) }}</div>
格式化时间老显示
date.js?t=1690877329898:3 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘getTime’)
at Proxy.formatDate (date.js?t=1690877329898:3:36)
at Proxy._sfc_render (BlogCard.vue:9:28)
at renderComponentRoot (runtime-core.esm-bundler.js:816:16)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5701:46)
at ReactiveEffect.run (reactivity.esm-bundler.js:178:19)
at instance.update (runtime-core.esm-bundler.js:5814:51)
at setupRenderEffect (runtime-core.esm-bundler.js:5822:5)
at mountComponent (runtime-core.esm-bundler.js:5612:5)
at processComponent (runtime-core.esm-bundler.js:5565:9)
at patch (runtime-core.esm-bundler.js:5040:11)
mock数据用的老师你的
1回答
-
TypeError: Cannot read properties of undefined (reading ‘getTime’)
看,这里有一句很明显的 JS 语法错误,你顺着这个错误先自己排查一下。
012023-08-01
相似问题