fix(post-helper): fixed an error where commentsCountDom is empty
This commit is contained in:
parent
69ffc208b8
commit
09b7f9633b
|
@ -92,7 +92,9 @@ function initToggleShowToc() {
|
||||||
// watch comments count
|
// watch comments count
|
||||||
watchPostCommentsCount() {
|
watchPostCommentsCount() {
|
||||||
const commentsCountDom = this.postToolsDom.querySelector('.post-comments-count')
|
const commentsCountDom = this.postToolsDom.querySelector('.post-comments-count')
|
||||||
|
if (!commentsCountDom) return
|
||||||
const config = { attributes: true, childList: true }
|
const config = { attributes: true, childList: true }
|
||||||
|
|
||||||
const callback = function (mutationsList) {
|
const callback = function (mutationsList) {
|
||||||
mutationsList.forEach((item) => {
|
mutationsList.forEach((item) => {
|
||||||
if (item.type === 'childList') {
|
if (item.type === 'childList') {
|
||||||
|
|
Loading…
Reference in New Issue