이 컴포넌트를 약간 수정하여 작동하게 만들었습니다. 즉, ‘날짜순 정렬’ 버튼을 추가한 것입니다.
여기서 설정으로 URL 쿼리를 전달했습니다:
unfinished; unfinished; ?tags=unfinished
created-time; created-time; ?order=created
그리고 스크립트에서 search 파라미터를 확인합니다:
api.modifyClass("component:navigation-item", {
active: Ember.computed("contentFilterMode", "filterMode", function() {
let contentFilterMode = this.get("content").get("filterMode");
if (decodeURIComponent(window.location.search) === location) { // search 파라미터 확인
return contentFilterMode.includes(filter); // 이 파라미터를 포함하면 active = true;
} else {
return this._super(contentFilterMode, this.get("filterMode"));
}
})
});
제 환경에서는 잘 작동하지만, 이 스크립트는 내부 부분만 새로고침하는 것이 아니라 페이지 전체를 새로고침합니다. 내부 토픽 컴포넌트만 새로고침할 수 있는 방법이 있을까요?