# Comment 通用评论系统 ## 使用 ### 作为组件使用 ``` # npm 安装 $ npm install git+https://git.links123.net/node/test_comment.git # yarn 安装 $ yarn add https://git.links123.net/node/test_comment.git ``` 然后在代码里面引入 `comment` 组件: ```jsx import Comment from 'comment' // ... render() { return ( ) } ``` **注意:最好,还需要在 HTML 文件里面引入阿里云 OSS SDK ``** ### 作为静态文件引入 首先引入 OSS SDK,用于直传文件到 OSS。 然后分别通过 link 和 script 标签引入打包后的文件。 再创建一个 id 为 `root-comment` 的标签,作为渲染通用评论的跟元素。 如下所示: ```html Page Title
``` ## 开发 ``` $ git clone https://git.links123.net/npm/comment $ cd comment $ yarn $ yarn start ``` - `yarn build` 将项目打包成一个单页应用 - `yarn lib` 将项目打包成一个组件 - `yarn prettier` 格式化代码 ## TODO - [ ] 前后端统一错误码 - [ ] type 和 businessID 的定义