Johani
(Joe)
3
你可以尝试类似这样的方法:
<script type="text/discourse-plugin" version="0.8">
api.modifyClass("model:composer", {
applyTopicTemplate() {
this._super(...arguments);
Ember.run.schedule("afterRender", () => {
// 在这里执行你的操作
});
}
});
</script>
这样应该可以让你在 Discourse 应用分类主题模板时添加一些自定义逻辑。
不过,这种编写方式已经有点过时了。如果你打算花大量时间研究 Discourse 主题,我也建议你阅读一下这篇文章,它会让你轻松很多。
9 个赞