vue-chat-im
``` npm install vue-chat-im@latest -S ``` ##### <font color='red'>\* 提示:</font>装完插件后,需要在 ```package.json``` 中手动修改插件版本为 ```latest``` ``` eg: "vue-chat-im": "latest" ```
36,575
| Install | |
|---|---|
npm install vue-chat-im@2.0.1 |
|
| Latest Version: | 2.0.1 |
| Vue: | 2 |
| Last Updated: | Oct 21, 2026 |
| Links: | npm |
Maintainer: kobe577590
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
| params | Description | type | default |
|---|---|---|---|
| imAccount | 用户imAccount | Stirng | 无 |
| imToken | 用户imToken | String | 无 |
| 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
| params | Description | type | default |
|---|---|---|---|
| title | 选择器title | Stirng | 无 |
| orgstructure | 选择器列表展示顺序 | Array | ["friend", "getAllOrg"] |
| isyourSelf | 是否包含自己 | Boolean | true |
| forward | 是否为转发 | Boolean | false |
| determine | 确认回调 | Function | 无 |
| closeCreateChatComponent | 取消回调 | Function | 无 |
Props
Version History
| Version | Released | License |
|---|---|---|
| 2.0.1 | ||
| 1.2.5 | ||
| 1.2.4 | ||
| 1.2.3 | ||
| 1.2.2 | ||
| 1.2.1 | ||
| 1.1.99 | ||
| 1.1.97 | ||
| 1.1.96 | ||
| 1.1.95 | ||
| 1.1.94 | ||
| 1.1.93 | ||
| 1.1.92 | ||
| 1.1.91 | ||
| 1.1.90 | ||
| 1.1.89 | ||
| 1.1.88 | ||
| 1.1.87 | ||
| 1.1.86 | ||
| 1.1.85 | ||
| 1.1.84 | ||
| 1.1.83 | ||
| 1.1.82 | ||
| 1.1.81 | ||
| 1.1.80 | ||
| 1.1.79 | ||
| 1.1.78 | ||
| 1.1.77 | ||
| 1.1.76 | ||
| 1.1.75 |
Showing the latest 30 of 115. See every release on npm
Pre-releases (337)
| Version | Released | License |
|---|---|---|
| 1.2.4-beta.2 | ||
| 1.2.4-beta.1 | ||
| 1.2.3-beta.5 | ||
| 1.2.3-beta.4 | ||
| 1.2.3-beta.3 | ||
| 1.2.3-beta.2 | ||
| 1.2.3-beta.1 | ||
| 1.2.1-beta.4 | ||
| 1.2.1-beta.3 | ||
| 1.2.1-beta.2 | ||
| 1.2.1-beta.1 | ||
| 1.1.99-beta.2 | ||
| 1.1.99-beta.1 | ||
| 1.1.98-beta.3 | ||
| 1.1.98-beta.2 | ||
| 1.1.98-beta.1 | ||
| 1.1.96-beta.1 | ||
| 1.1.95-beta.1 | ||
| 1.1.94-beta.2 | ||
| 1.1.94-beta.1 | ||
| 1.1.93-beta.2 | ||
| 1.1.93-beta.1 | ||
| 1.1.92-beta.2 | ||
| 1.1.92-beta.1 | ||
| 1.1.91-beta.1 | ||
| 1.1.90-beta.1 | ||
| 1.1.89-beta.2 | ||
| 1.1.89-beta.1 | ||
| 1.1.88-beta.3 | ||
| 1.1.88-beta.2 |
Showing the latest 30 of 337. See every release on npm