请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

格式化时间函数调用

<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 语法错误,你顺着这个错误先自己排查一下。

0 回复 有任何疑惑可以回复我~
  • 提问者 一逐星一 #1
    解决了。。没把字符串的日期 转换成时间戳
    回复 有任何疑惑可以回复我~ 2023-08-01 22:52:34
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号