fix: comment actions not work

This commit is contained in:
tanjinzhou 2020-08-14 14:00:25 +08:00
parent d3d631b862
commit 7796894e01
4 changed files with 50 additions and 17 deletions

View File

@ -73,7 +73,9 @@ exports[`renders ./antdv-demo/docs/comment/demo/list.md correctly 1`] = `
<div class="ant-comment-content-detail">
<p>We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.</p>
</div>
<!---->
<ul class="ant-comment-actions">
<li><span>Reply to</span></li>
</ul>
</div>
</div>
<!---->
@ -90,7 +92,9 @@ exports[`renders ./antdv-demo/docs/comment/demo/list.md correctly 1`] = `
<div class="ant-comment-content-detail">
<p>We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.</p>
</div>
<!---->
<ul class="ant-comment-actions">
<li><span>Reply to</span></li>
</ul>
</div>
</div>
<!---->
@ -117,7 +121,9 @@ exports[`renders ./antdv-demo/docs/comment/demo/nested.md correctly 1`] = `
<div class="ant-comment-content-detail">
<p> We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure). </p>
</div>
<!---->
<ul class="ant-comment-actions">
<li><span>Reply to</span></li>
</ul>
</div>
</div>
<div class="ant-comment-nested">
@ -131,7 +137,9 @@ exports[`renders ./antdv-demo/docs/comment/demo/nested.md correctly 1`] = `
<div class="ant-comment-content-detail">
<p> We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure). </p>
</div>
<!---->
<ul class="ant-comment-actions">
<li><span>Reply to</span></li>
</ul>
</div>
</div>
<div class="ant-comment-nested">
@ -145,7 +153,9 @@ exports[`renders ./antdv-demo/docs/comment/demo/nested.md correctly 1`] = `
<div class="ant-comment-content-detail">
<p> We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure). </p>
</div>
<!---->
<ul class="ant-comment-actions">
<li><span>Reply to</span></li>
</ul>
</div>
</div>
<!---->
@ -160,7 +170,9 @@ exports[`renders ./antdv-demo/docs/comment/demo/nested.md correctly 1`] = `
<div class="ant-comment-content-detail">
<p> We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure). </p>
</div>
<!---->
<ul class="ant-comment-actions">
<li><span>Reply to</span></li>
</ul>
</div>
</div>
<!---->

View File

@ -55,10 +55,11 @@ const Comment = {
</div>
);
const actionDom =
actions && actions.length ? (
<ul class={`${prefixCls}-actions`}>{this.getAction(actions)}</ul>
) : null;
const actionDom = actions ? (
<ul class={`${prefixCls}-actions`}>
{this.getAction(Array.isArray(actions) ? actions : [actions])}
</ul>
) : null;
const authorContent = (
<div class={`${prefixCls}-content-author`}>

View File

@ -1,8 +1,16 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./antdv-demo/docs/mentions/demo/async.md correctly 1`] = `<div class="ant-mentions"><textarea rows="1"></textarea></div>`;
exports[`renders ./antdv-demo/docs/mentions/demo/async.md correctly 1`] = `
<div class="ant-mentions"><textarea rows="1"></textarea>
<!---->
</div>
`;
exports[`renders ./antdv-demo/docs/mentions/demo/basic.md correctly 1`] = `<div class="ant-mentions"><textarea rows="1"></textarea></div>`;
exports[`renders ./antdv-demo/docs/mentions/demo/basic.md correctly 1`] = `
<div class="ant-mentions"><textarea autofocus="" rows="1"></textarea>
<!---->
</div>
`;
exports[`renders ./antdv-demo/docs/mentions/demo/form.md correctly 1`] = `
<form class="ant-form ant-form-horizontal">
@ -32,15 +40,27 @@ exports[`renders ./antdv-demo/docs/mentions/demo/form.md correctly 1`] = `
</form>
`;
exports[`renders ./antdv-demo/docs/mentions/demo/placement.md correctly 1`] = `<div class="ant-mentions"><textarea rows="1"></textarea></div>`;
exports[`renders ./antdv-demo/docs/mentions/demo/placement.md correctly 1`] = `
<div class="ant-mentions"><textarea rows="1"></textarea>
<!---->
</div>
`;
exports[`renders ./antdv-demo/docs/mentions/demo/prefix.md correctly 1`] = `<div class="ant-mentions"><textarea rows="1" placeholder="input @ to mention people, # to mention tag"></textarea></div>`;
exports[`renders ./antdv-demo/docs/mentions/demo/prefix.md correctly 1`] = `
<div class="ant-mentions"><textarea rows="1" placeholder="input @ to mention people, # to mention tag"></textarea>
<!---->
</div>
`;
exports[`renders ./antdv-demo/docs/mentions/demo/readonly.md correctly 1`] = `
<div>
<div style="margin-bottom: 10px;">
<div class="ant-mentions ant-mentions-disabled"><textarea disabled="disabled" rows="1" placeholder="this is disabled Mentions"></textarea></div>
<div class="ant-mentions ant-mentions-disabled"><textarea disabled="" rows="1" placeholder="this is disabled Mentions"></textarea>
<!---->
</div>
</div>
<div class="ant-mentions"><textarea rows="1" placeholder="this is readOnly a-mentions" readonly=""></textarea>
<!---->
</div>
<div class="ant-mentions"><textarea rows="1" placeholder="this is readonly a-mentions" readonly="readonly"></textarea></div>
</div>
`;

View File

@ -4,7 +4,7 @@
</div>
</template>
<script>
import demo from '../antdv-demo/docs/menu/demo/template';
import demo from '../antdv-demo/docs/comment/demo/nested';
export default {
components: {