0.1.0 • Published 3 years ago

iview-comment-tree v0.1.0

Weekly downloads
29
License
MIT
Repository
-
Last release
3 years ago

安装

npm install iview-comment-tree

使用

//main.js
import ViewUI from "view-design";
import IViewCommentTree from "../index";
Vue.use(ViewUI);
Vue.use(IViewCommentTree);

<template>
  <div id="app">
    <iview-comment-tree
      class="middle"
      :comments="comments"
      @on-comment="reply"
    />
  </div>
</template>

<script>
import IviewCommentTree from "iview-comment-tree";

export default {
  name: "App",
  components: {
    IviewCommentTree
  },
}
</script>

截图

Props

属性描述类型接受值默认值
pageSize每页评论数Number正整数10
defaultPlaceholder默认placeholderString-"写下你的评论"
RenderTime时间渲染函数Function参数为Date,返回值为字符串的函数默认渲染函数
comments评论数组树Array见comment演示默认值
avatarSize头像大小String或Number可选为 large、small、default或具体数字"small"

comments

属性描述类型接受值
username用户名String-
content评论内容String-
CreateTime日期Date-
ReplyComments评论数组树Arraycomments,可空
avatar头像String一个指向图片的url

event

事件名说明返回值
on-comment回复评论后的事件{content:评论内容,reply:所回复的评论的引用,若无则为null}

示例

查看src/examples

或者本地运行npm run serve

或者查看线上示例

LICENSE

MIT

0.1.0

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago