Fix:修复最新评论切换无法获取
This commit is contained in:
parent
fc8f345a0d
commit
1f5ef43b17
|
@ -4,11 +4,9 @@
|
||||||
<div class="card-widget card-recent-post" th:fragment="comments">
|
<div class="card-widget card-recent-post" th:fragment="comments">
|
||||||
<div class="item-headline"><i class="iconfont icon-comment-dots"></i><span>最新评论</span></div>
|
<div class="item-headline"><i class="iconfont icon-comment-dots"></i><span>最新评论</span></div>
|
||||||
<div class="aside-list" id="newcomm">
|
<div class="aside-list" id="newcomm">
|
||||||
|
<script th:src="@{/assets/libs/twikoo/twikoo.all.min.js}"></script>
|
||||||
</div>
|
<script th:if="${theme.config.comments.twikoo && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.envId)}">
|
||||||
</div>
|
(()=>{
|
||||||
<script th:src="@{/assets/libs/twikoo/twikoo.all.min.js}"></script>
|
|
||||||
<script th:if="${theme.config.comments.twikoo && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.envId)}">
|
|
||||||
const pagesize = [[${theme.config.sidebar.newcommentnumber}]];
|
const pagesize = [[${theme.config.sidebar.newcommentnumber}]];
|
||||||
const defaultpagesize = 5;
|
const defaultpagesize = 5;
|
||||||
const finalpagesize = pagesize <= 0 ? defaultpagesize : pagesize;
|
const finalpagesize = pagesize <= 0 ? defaultpagesize : pagesize;
|
||||||
|
@ -35,10 +33,16 @@
|
||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
});
|
});
|
||||||
document.querySelector('#newcomm').innerHTML = commenthtml;
|
let necomm = document.querySelector('#newcomm')
|
||||||
|
necomm.innerHTML = commenthtml;
|
||||||
|
window.lazyLoadInstance && window.lazyLoadInstance.update()
|
||||||
|
window.pjax && window.pjax.refresh(necomm)
|
||||||
}).catch(function (err) {
|
}).catch(function (err) {
|
||||||
// 发生错误
|
// 发生错误
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
</script>
|
})();
|
||||||
|
</script>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue