zj-plugin-kf-client

ZJ Technology Enterprise Intranet Customer Client
2,192
Install
npm install zj-plugin-kf-client
Latest Version:1.4.22
Vue:2
License:ISC
Last Updated:Aug 31, 2023
Links: npm
Maintainer: kobe577590

zj-plugin-kf-client

插件依赖于 element-ui和vuex, 请确保项目里已安装注册。

1.安装插件
npm install zj-plugin-kf-client@latest -S
* 提示:装完插件后,需要在 package.json 中手动修改插件版本为 latest
eg: "zj-plugin-kf-client": "latest"
2.引入插件
// 在 main.js 中引入并注册
import store from './store'
import KfClient from 'zj-plugin-kf-client'

Vue.use(KfClient, { store })  // 注册
2. 使用插件
// 打开客服窗口
this.$kfClient(options)

// 示例
this.$kfClient({
  imUser: { accountId: this.imAccount, token: this.imToken },
  env: env,    // 当前环境,请使用项目中类似VUE_APP_NAME的变量传入,以区分不同环境
  onClose: function () {
    // 关闭回调
  }
})

参数说明

Options
params Description type default
imUser 用户im信息 Object { accountId: 'imAccount', token: 'imToken' }
env 项目当前环境
传入当前环境变量即可
String 测试:'dev','development','test','testing';
预发:'pre';
生产:'pro','prod','production'
onClose 关闭客服窗口回调 Function
*env 说明

请传入能代表不同环境的变量,例如项目中配置的VUE_APP_NAME,或自定义配置(VUE_APP_XXXX)

 举个栗子,以VUE_APP_NAME为例:
 测试环境:VUE_APP_NAME = dev 或 development 或 test 或 testing // 选其一
 预发环境:VUE_APP_NAME = pre // 预发仅此一种
 生产环境:VUE_APP_NAME = pro 或 prod 或 production // 选其一
 参照上面配置参数中支持的环境变量传入即可。

Version History

Version Released Vue License
1.4.22 ^2.6.11 ISC
1.4.21 ^2.6.11 ISC
1.4.20 ^2.6.11 ISC
1.4.19 ^2.6.11 ISC
1.4.18 ^2.6.11 ISC
Pre-releases (60)
Version Released Vue License
1.4.21-beta.8 ^2.6.11 ISC
1.4.21-beta.7 ^2.6.11 ISC
1.4.21-beta.6 ^2.6.11 ISC
1.4.21-beta.5 ^2.6.11 ISC
1.4.21-beta.4 ^2.6.11 ISC