Giter VIP home page Giter VIP logo

iview-comment-tree's Introduction

iview comment tree

npm version downloads license MIT

安装

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 默认placeholder String - "写下你的评论"
RenderTime 时间渲染函数 Function 参数为Date,返回值为字符串的函数 默认渲染函数
comments 评论数组树 Array 见comment 演示默认值
avatarSize 头像大小 String或Number 可选为 large、small、default或具体数字 "small"

comments

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

event

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

示例

查看src/examples

或者本地运行npm run serve

或者查看线上示例

LICENSE

MIT

iview-comment-tree's People

Contributors

unnatural16 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.