diff --git a/src/disqus.js b/src/disqus.js index d69781c..7958646 100644 --- a/src/disqus.js +++ b/src/disqus.js @@ -482,21 +482,14 @@ function getCommentList(data) { } function renderComment(data) { - var commentContainerTpl = ` -
- -
- `; - - var commentItemTpl = ` - - ` - - var commentItem; - data.map(function (comment) { - console.log(comment) + var disqusjsBaseTpl = '
'; + document.getElementById('disqus_thread').innerHTML = disqusjsBaseTpl; + + var commentItemTpl = '
  • <% if (comment.author.profileUrl) { %><% } %><% if (comment.author.profileUrl) { %><% } %>
    <% if (comment.author.profileUrl) { %><% } %><%= comment.author.name %><% if (comment.author.profileUrl) { %><% } %>
    <%- comment.message %>
  • '; + + data.map(function (s) { + var html = baidu.template(commentItemTpl, s); + document.getElementById('dsqjs-list').insertAdjacentHTML('beforeend', html); }) }