vuepress-reco / vuepress-theme-reco

🎨 This is the repo for vuepress-theme-reco 2.
https://vuepress-theme-reco.recoluan.com
MIT License
575 stars 183 forks source link

last-updated display problem #147

Closed Gg1372 closed 1 year ago

Gg1372 commented 1 year ago

在文章最后总是需要显示最后修改时间,vuepress默认主题默认内置了最后时间显示的插件,但是在尝试使用vuepress-theme-rece时,会出现显示异常的问题

我在阅读代码并进行修改的时候,发现在vuepress-theme-rece 的 Page 组件中,该文件重写了默认主题 lastUpdated 显示的地方,和默认主题在使用该属性( lastUpdated ) 已有,都是使用computed 计算属性。

我尝试在 Markdown 中使用 vue 来修改该属性,发现即使修改成功,但在 Page 组件中,却无法监视到该属性依赖的更改,即Page组件中无法监视到 this.$page的更改。

一开始我是在Markdown中直接使用 this.$page.lastUpdated 来修改该属性,但Page 组件中无法对该修改做出响应,怀疑是 vue2 中响应式的问题,因此专用 this.$set( ) 来修改,但也发现无效。

希望作者看到能修复这个问题

recoluan commented 1 year ago

请将问题描述清楚:

  1. 包括你的依赖版本
  2. 问题具体异常是什么,如何复现
  3. 你为什么要手动修改