모두 안녕하세요,
토픽 모델 클래스 javascripts/discourse/app/models/topic.js의 아래에 언급된 메서드를 수정하고 싶습니다.
@discourseComputed("excerpt")
excerptTruncated(excerpt) {
return excerpt && excerpt.substr(excerpt.length - 8, 8) === "…";
}
아래 코드를 사용해 보았지만 작동하지 않습니다:
<script type="text/discourse-plugin" version="0.8">
const topicClass = api.container.factoryFor('model:topic');
const discourseComputed = require("discourse-common/utils/decorators").default;
topicClass.class.reopenClass({
@discourseComputed("excerpt")
excerptTruncated(excerpt) {
return excerpt && excerpt.substr(topic_excerpt.length - 8, 8) === "…";
}
});
</script>