@kengo98/vue-easy-comments
v1.0.1
Published
A simple vuejs plugin to add comments
Downloads
3
Readme
vue-easy-comments
Installation
$ npm install @kengo98/vue-easy-comments
OR
$ yarn add @kengo98/vue-easy-comments
Usage
In a single component
<template>
<EasyComments
:pluginConfig="pluginConfig"
:apiConfig="apiConfig"
:attrNameConfig=attrNameConfig
>
</EasyComments>
</template>
<script>
import EasyComments from '@kengo98/vue-easy-comments'
import '@kengo98/vue-easy-comments/dist/vue-easy-comments.css'
export default {
name: 'App',
components: {
EasyComments
},
data(){
return{
attrNameConfig: {
id: "id",
text:"comment",
userName: "personName",
userPicture: "photo",
dateCreated: "createdAt",
userId: "userId",
commentId: "commentId"
},
pluginConfig: {
useAPI: true
},
apiConfig:{
baseURL: "https://my-web-page/api/v1",
endpoint: "/comments",
headers: {
'Content-Type': 'application/json'
}
},
}
}
}
</script>