对计算属性中get和set的理解
原文参考:https://blog.csdn.net/xiaxiaoxian/article/details/79304004
element-admin设置时间
代码路径:vue-element-admin/src/views/example/components/ArticleDetail.vue
1 2 3 4 5 6 7 8 9 10 11 12 | displayTime: { // set and get is useful when the data // returned by the back end api is different from the front end // back end return => "2013-06-25 06:59:25" // front end need timestamp => 1372114765000 get () { return (+ new Date( this .postForm.display_time)) }, set (val) { this .postForm.display_time = new Date(val) } } |
做有积累的事~~
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】Flutter适配HarmonyOS 5知识地图,实战解析+高频避坑指南
【推荐】凌霞软件回馈社区,携手博客园推出1Panel与Halo联合终身会员
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步