Skip to content

Commit 102b918

Browse files
committed
fix: comment render nest style bug
1 parent 548f10d commit 102b918

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

components/comment/__tests__/__snapshots__/demo.test.js.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
124124
</ul>
125125
</div>
126126
</div>
127-
<div class="undefined-nested">
127+
<div class="ant-comment-nested">
128128
<div class="ant-comment">
129129
<div class="ant-comment-inner">
130130
<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>
@@ -141,7 +141,7 @@ exports[`renders ./components/comment/demo/nested.md correctly 1`] = `
141141
</ul>
142142
</div>
143143
</div>
144-
<div class="undefined-nested">
144+
<div class="ant-comment-nested">
145145
<div class="ant-comment">
146146
<div class="ant-comment-inner">
147147
<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>

components/comment/index.jsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ const Comment = {
3030
const actionList = actions.map((action, index) => <li key={`action-${index}`}>{action}</li>);
3131
return actionList;
3232
},
33-
renderNested(children) {
34-
const { prefixCls } = this.$props;
35-
33+
renderNested(prefixCls, children) {
3634
return <div class={`${prefixCls}-nested`}>{children}</div>;
3735
},
3836
},
@@ -85,7 +83,7 @@ const Comment = {
8583
return (
8684
<div class={prefixCls} {...{ on: this.$listeners }}>
8785
{comment}
88-
{children ? this.renderNested(children) : null}
86+
{children ? this.renderNested(prefixCls, children) : null}
8987
</div>
9088
);
9189
},

0 commit comments

Comments
 (0)