在 Discourse 中使用 topic-list-item 组件在主题级别实现喜欢和不喜欢功能是否可行?

我已经修改了 Discourse 的 topic-list-item 组件,使其能够点赞话题。但是,我在实现 toggleLike 功能时遇到了困难,并且发现在刷新时 topic 对象的 liked 属性被设置为 null。我想知道是否可以在话题级别实现点赞和取消点赞功能,以及在刷新时 liked 属性重置的任何最佳实践。

Dislikes are mostly seen as not conducive to civilized Discussion. But you migth check out Discourse Reactions. There are also a bunch of topics matching “dislike” if you search.

不喜欢通常被认为不利于文明的讨论。但你也许可以查看 https://meta.discourse.org/t/discourse-reactions/183261。如果你搜索“dislike”,还会找到很多相关主题。

2 个赞