diff --git a/packages/devui-vue/devui/comment/src/comment-types.ts b/packages/devui-vue/devui/comment/src/comment-types.ts index ea36c2ab8e..a98ed8b723 100644 --- a/packages/devui-vue/devui/comment/src/comment-types.ts +++ b/packages/devui-vue/devui/comment/src/comment-types.ts @@ -1,6 +1,11 @@ import type { PropType, ExtractPropTypes } from 'vue'; + export interface IcommentProps { - [prop: string]: any; + actions?: []; + author?: []; + avatar?: []; + content?: []; + datetime?: []; } // TODO: props 参数的类型需要明确定义 diff --git a/packages/devui-vue/devui/comment/src/comment.tsx b/packages/devui-vue/devui/comment/src/comment.tsx index 2c18cb136b..14a0ba5d85 100644 --- a/packages/devui-vue/devui/comment/src/comment.tsx +++ b/packages/devui-vue/devui/comment/src/comment.tsx @@ -22,18 +22,17 @@ export default defineComponent({ slots: ['actions', 'author', 'avatar', 'content', 'datetime'], setup(props: CommentProps, { slots }) { return () => { - const getAction = (actions: any) => { + const getAction = (actions: []) => { if (!actions || !actions.length) { return null; } - const actionList = actions.map((action: any, index: number) => ( + const actionList = actions.map((action: [], index: number) => (