@dansmaculotte/vue-zendesk

中文文档
0.4.7发布于 2022/12/02MITCommonJS零依赖近 30 天下载 6677

Vue plugin for Zendesk Web Widget

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录5 节
  1. Setup
  2. Options
  3. Usage
  4. Development
  5. License

vue-zendesk

npm version npm downloads Dependencies Standard JS

Vue.js plugin for Zendesk Web Widget

This plugin allows you to configure and add Zendesk Web Widget

Zendesk Web Widget Documentation

Setup

  1. Add the @dansmaculotte/vue-zendesk dependency with yarn or npm to your project
  2. Configure it:
import Vue from 'vue'
import Zendesk from '@dansmaculotte/vue-zendesk'

Vue.use(Zendesk, {
  key: 'YOUR_ZENDESK_KEY',
  disabled: true,
  hideOnLoad: true,
  settings: {
    webWidget: {
      color: {
        theme: '#78a300'
      }
    }
  }
})

Options

disabled

disabled option allows you to prevent automatic script loading, to comply with GDPR.

You can manually load it by calling this.$zendesk.load(YOUR_ZENDESK_KEY).

hideOnLoad

When Zendesk Web Widget is initialized it automatically shows the widget, to prevent this you can set to true this option so you can manually show it after.

settings

You can view Zendesk Web Widget available settings here.

Usage

You can use any method coming from the official documentation. Every methods are accessible from $zendesk object.

For example:

Vue.$zendesk.hide()
// In a vue component
this.$zendesk.show()

You can also listen to loaded event emitted on script load, open on widget open and close on widget close.

For example:

this.$zendesk.$on('loaded', (event) => {
  this.$zendesk.identify({
    name: 'John'
  })
})

this.$zendesk.$on('open', () => {
  console.log('Widget is open')
})

this.$zendesk.$on('close', () => {
  console.log('Widget is closed')
})

You can access to Zendesk Web Widget instance through this.$zendesk.zE or window.zE objects.

For example:

this.$zendesk.zE('webWidget', 'hide')
window.zE('webWidget', 'hide')

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using npm run dev

License

MIT License

版本与发布记录

@dansmaculotte/vue-zendesk 共发布 21 个版本,首次发布于 2019/04/24;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.4.7latest2022/12/023 年前
0.4.62022/07/204 年前
0.4.42021/06/085 年前
0.4.32021/05/255 年前
0.4.22021/05/255 年前
0.4.12020/05/286 年前

关于 @dansmaculotte/vue-zendesk 的常见问题

@dansmaculotte/vue-zendesk 是什么?

Vue plugin for Zendesk Web Widget注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @dansmaculotte/vue-zendesk?

在项目目录运行 npm install @dansmaculotte/vue-zendesk,或使用 pnpm add / yarn add / bun add。

@dansmaculotte/vue-zendesk 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dansmaculotte__vue-zendesk 是否存在。

@dansmaculotte/vue-zendesk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@dansmaculotte/vue-zendesk 可以商用吗?

@dansmaculotte/vue-zendesk 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dansmaculotte/vue-zendesk 的下载量有多少?

根据 npm 官方下载统计,@dansmaculotte/vue-zendesk 在 2026/10/12 – 2026/11/10 这 30 天内被下载 6,677 次,日均约 223 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dansmaculotte/vue-zendesk 还在维护吗?

最新版本 0.4.7 发布于 2022/12/02(3 年前);至今共发布 21 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/04/24。作者已将其标记为弃用,新项目建议寻找替代方案。