Socket
Socket
Sign inDemoInstall

vue-chat-im

Package Overview
Dependencies
99
Maintainers
1
Versions
309
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vue-chat-im

``` npm install vue-chat-im@latest -S ``` ##### <font color='red'>\* 提示:</font>装完插件后,需要在 ```package.json``` 中手动修改插件版本为 ```latest``` ``` eg: "vue-chat-im": "latest" ```


Version published
Weekly downloads
36
decreased by-82.94%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue-chat-im

1.安装
npm install vue-chat-im@latest -S
* 提示:装完插件后,需要在 package.json 中手动修改插件版本为 latest
eg: "vue-chat-im": "latest"
2.引入

import store from './store'
import ZjkjIm from "vue-chat-im"

Vue.use(ZjkjIm);
ZjkjIm.mergeStore(store); // vuex 注册im模块
3.使用

注意:确保imAccount和imToken都有值

 <zjkj-im
    :imAccount="imAccount"
    :imToken="imToken"
    :isShow="isShow"
    @close="closeIm"
 ></zjkj-im>
Props
paramsDescriptiontypedefault
imAccount用户imAccountStirng
imToken用户imTokenString
isShow显示隐藏窗口Boolean一定用局部变量控制显示隐藏
close关闭窗口回调Function
Event

im注册了全局变量,可直接使用全局变量打开会话

1.交流:$imToChat(imAccount)
 this.$imToChat(imAccount) // 打开会话
 imAccount:为交流对象的imAccount
 
 兼容旧方法,通过zjkj-im组件的引用对象调用
 this.$store.commit("SEND_MESSAGE");    // 需先打开会话
 this.$nextTick(() => {
   this.$refs.zjkjImRef.findFriend(imAccount);
 });
2.分享:$imShareMsg(url)
this.$imShareMsg('https://www.xxx.com') // 打开选择用户,分享
3.使用initiateGroup

注意:该选择器仅处理选择人员、业务不处理 以下示例:分享调用选择器

 <initiateGroup
    title="立即分享"
    :orgstructure="['friend', 'group', 'recent', 'getAllOrg']"
    :isyourSelf="false"
    :forward="true"
    @determine="determine"
    @closeCreateChatComponent=“closeCreateChatComponent”
 ></initiateGroup>
Props
paramsDescriptiontypedefault
title选择器titleStirng
orgstructure选择器列表展示顺序Array["friend", "getAllOrg"]
isyourSelf是否包含自己Booleantrue
forward是否为转发Booleanfalse
determine确认回调Function
closeCreateChatComponent取消回调Function
Props

FAQs

Last updated on 25 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc