1.0.5 • Published 7 years ago
miniprogram-custom-comment v1.0.5
miniprogram-custom-comment
小程序自定义组件-评论模块:
- 简单的小程序评论组件
- 代码结构有待优化
属性
| 属性名称 | 类型 | 默认 | 必填 | 说明 |
|---|---|---|---|---|
| commentData | Object | 否 | 评论数据 | |
| bottom | Int | 0 | 是 | 设置距离底部高度 |
| bindAuthComment | ElementPosition | 是 | 绑定输入法提交事件 | |
| bindAuthCommentButton | ElementPosition | 是 | 绑定按钮提交事件 | |
| bindClearComment | ElementPosition | 是 | 清空输入框 |
commentData 属性
| 属性名称 | 类型 | 默认 | 必填 | 说明 |
|---|---|---|---|---|
| title | String | 否 | 评论区标题 | |
| placeholder | String | 是 | 输入框默认值 | |
| commentText | String | 是 | 按钮文本 | |
| commentArr | Array | 否 | 评论列表 |
commentArr 属性
| 属性名称 | 类型 | 默认 | 必填 | 说明 |
|---|---|---|---|---|
| nickName | String | 是 | 用户昵称 | |
| name | String | 否 | 当不为空时会标注(企业微信),用来区分微信普通用户和企业用户 | |
| avatarUrl | String | /images/user.png | 否 | 头像地址 |
| content | String | 是 | 内容不能少于6个字 | |
| lastTime | String | 是 | 发布时间 |
使用方法
- 安装依赖:
npm i miniprogram-custom-comment- page.json 中添加配置
{
"usingComponents": {
"comment": "miniprogram-custom-comment"
}
}- page.wxml 中添加组件
<comment placeholder="" comment-data="[]" bottom="0" bindAuthComment="{{事件}}" bindAuthCommentButton="{{事件}}" bindClearComment="{{事件}}"></comment>反馈建议
E-mail: admin@qzwu.com