UNPKG

1.85 kBTypeScriptView Raw
1import { ComponentType } from 'react'
2import { StandardProps } from './common'
3interface CommentDetailProps extends StandardProps {
4 /** 评论核心参数
5 * @supported swan
6 */
7 commentParam: CommentDetailProps.ICommentParam
8
9 /** 评论 ID
10 * @supported swan
11 */
12 srid: string
13
14 /** 滚动方式为页面滚动,若组件作为浮层使用,该参数需设为 false
15 * @supported swan
16 * @default true
17 */
18 isPageScroll?: boolean
19
20 /** 是否需要底部 toolbar,若使用开发者自定义的底部 toolbar,该参数需设为 false
21 * @supported swan
22 * @default true
23 */
24 needToolbar?: boolean
25
26 /** 是否需要详情顶部父级评论的点赞按钮,默认显示
27 * @supported swan
28 * @default true
29 */
30 needLikeBtn?: boolean
31
32 /** 删除详情后是否返回列表项,默认一站式逻辑。若使用浮层,请设置改属性为 false
33 * @supported swan
34 * @default true
35 */
36 backListAfterDelete?: boolean
37
38 /** 用于调起评论发布器发布评论
39 * @supported swan
40 * @default false
41 */
42 addComment?: boolean
43
44 /** 删除整体详情内容时触发,返回数据为{status, data:{srid}}
45 * @supported swan
46 */
47 onDelete?: CommonEventFunction
48}
49namespace CommentDetailProps {
50 interface ICommentParam {
51 /** 被点赞的文章的 id,与 path 参数一一对应
52 * @example "20200101"
53 */
54 snid: string
55
56 /** 文章标题 */
57 title: string
58
59 /** 智能小程序内页链接,最长不能超过 194 字符
60 * @example "/pages/index/index"
61 */
62 path: string
63 }
64}
65
66/** 评论详情
67 * @classification open
68 * @supported swan
69 * @see https://smartprogram.baidu.com/docs/develop/extended/component-content/comment-detail/
70 */
71declare const CommentDetail: ComponentType<CommentDetailProps>
72export { CommentDetail, CommentDetailProps }