v-comment

``` npm i v-comment -save ```

Usage no npm install needed!

<script type="module">
  import vComment from 'https://cdn.skypack.dev/v-comment';
</script>

README

v-comment

npm i v-comment -save

usage

<v-comment 
  :list="list<CommentProps>"
  @login="handleLogin"
  @submit="handleSubmit"
  @del="handleDel"
/>

<script>
const handleSubmit = (input, inputCompiler) {
  // ...
}
</script>

<style lang="less">
@border-color: #eee;
@bg-color: #f2f2f2;
@main-color: #4e9afa;
@import '~v-comment/src/style/index.less';
</style>

类型声明

type User = {
  id: string
  name: string
  avatar: string
}

export type CommentListItem = {
  id: string
  user: User
  createdTimeStamp: number
  input: string
  inputCompiler: string
}

export type CommentList = Array<CommentListItem>

export type CommentProps = {
  user?: User
  nums: number
  list: CommentList
}

build component

npm run build