Skip to content

Commit

Permalink
fix: comment render nest style bug (#1389)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkwolf authored and tangjinzhou committed Nov 7, 2019
1 parent 548f10d commit 094f032
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/comment/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
</ul>
</div>
</div>
<div class="undefined-nested">
<div class="ant-comment-nested">
<div class="ant-comment">
<div class="ant-comment-inner">
<div class="ant-comment-avatar"><span class="ant-avatar ant-avatar-circle ant-avatar-image"><img src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" alt="Han Solo"></span></div>
Expand All @@ -141,7 +141,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
</ul>
</div>
</div>
<div class="undefined-nested">
<div class="ant-comment-nested">
<div class="ant-comment">
<div class="ant-comment-inner">
<div class="ant-comment-avatar"><span class="ant-avatar ant-avatar-circle ant-avatar-image"><img src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" alt="Han Solo"></span></div>
Expand Down
6 changes: 2 additions & 4 deletions components/comment/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const Comment = {
const actionList = actions.map((action, index) => <li key={`action-${index}`}>{action}</li>);
return actionList;
},
renderNested(children) {
const { prefixCls } = this.$props;

renderNested(prefixCls, children) {
return <div class={`${prefixCls}-nested`}>{children}</div>;
},
},
Expand Down Expand Up @@ -85,7 +83,7 @@ const Comment = {
return (
<div class={prefixCls} {...{ on: this.$listeners }}>
{comment}
{children ? this.renderNested(children) : null}
{children ? this.renderNested(prefixCls, children) : null}
</div>
);
},
Expand Down

0 comments on commit 094f032

Please sign in to comment.