1 Star 4 Fork 306

nickorwu / JwChat

forked from 四铢半两 / JwChat 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

JwChat

介绍

一款基于Vue和ElementUI极简的聊天框组件 本项目是一款极简的数据驱动为主的聊天框组件。 新增表情包可自动匹配微信表情。 新增聊天窗口配置组件,可以自由配置 顶部状态栏 和 右侧信息栏

安装

  • 使用 npm 安装

    npm install jwchat
  • 使用 yarn 安装

    yarn add jwchat

文档

官方文档

使用

  1. 因为本组件是基于 element-ui 开发。首先需要引入 element-ui

    npm install element-ui
  2. main.js 中引入组件

    import ElementUI from 'element-ui';
    import 'element-ui/lib/theme-chalk/index.css';
    Vue.use(ElementUI);
    
    import Chat from 'jwchat';
    import 'jwchat/lib/JwChat.css';
    Vue.use(Chat)
  3. *.vue 中引入

    <JwChat-index
          :taleList="list"
       @enter="bindEnter"
          @bindCover="bindCover"
          v-model="inputMsg"
          :toolConfig="tool"
        />

组件文档

参数配置


Attribute

参数 说明 类型 可选值 默认值
v-model 输入框中的文字 String - ""
taleList 会话内容 Array - []
toolConfig 工具烂配置 Object - {}
width 聊天框宽度 string - 550px
height 聊天框高度 string - 500px

Methods

参数 说明 参数
enter 输入框点击就发送或者回车触发的事件 输入框中的文字
  • taleList

// 格式
[
    {
        "date": "2020/04/25 21:19:07",
        "text": { "text": "起床不" },
        "mine": false,
        "name": "只盼流星不盼雨",
        "img": "image/two.jpeg"
    },
    {
        "date": "2020/04/16 21:19:07",
        "text": { "text": "我不饿" },
        "mine": true,
        "name": "留恋人间不羡仙",
        "img": "image/three.jpeg"
    },
]

// data 用来展示时间数据
// text 用来展示本条会话内容
// mine 本条数据是否是我发的
// img 用户头像
  • toolConfig

{
    // file img video 现在只配置了三个图标
    show: ['file', 'img'],
    callback: this.toolEvent
}
    
 toolEvent (type/* 当前点击的按钮类型 */) {
     alert(type)
 }    

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

声明

  • 本代码借鉴于AVue

交流学习

  • 球球群 :235689934
MIT License Copyright (c) 2020 四铢半两 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一款基于vue、 element-ui 的前端组件;极简、轻量以战术数据为主的聊天界面。只需一个标签就可呈现通讯界面 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/nickorwu/chat.git
git@gitee.com:nickorwu/chat.git
nickorwu
chat
JwChat
master

搜索帮助