【问题标题】:Integrate LiveChatInc widget with NuxtJs将 LiveChatInc 小部件与 NuxtJs 集成
【发布时间】:2021-11-21 10:44:23
【问题描述】:

我正在为我的项目使用 NuxtJS,并且我正在尝试根据此页面集成 LiveChatInc 聊天:https://developers.livechat.com/docs/extending-chat-widget/javascript-api#getting-started

我尝试使用中间件输入 JS 代码,但 Eslint 给我错误:

window.__lc = window.__lc || {};
window.__lc.license = <LICENSE_NUMBER>;
;(function(n,t,c){function i(n){return e._h?e._h.apply(null,n):e._q.push(n)}var e={_q:[],_h:null,_v:"2.0",on:function(){i(["on",c.call(arguments)])},once:function(){i(["once",c.call(arguments)])},off:function(){i(["off",c.call(arguments)])},get:function(){if(!e._h)throw new Error("[LiveChatWidget] You can't use getters before load.");return i(["get",c.call(arguments)])},call:function(){i(["call",c.call(arguments)])},init:function(){var n=t.createElement("script");n.async=!0,n.type="text/javascript",n.src="https://cdn.livechatinc.com/tracking.js",t.head.appendChild(n)}};!n.__lc.asyncInit&&e.init(),n.LiveChatWidget=n.LiveChatWidget||e}(window,document,[].slice))

有人能指出我正确的方向吗?谢谢。

【问题讨论】:

    标签: nuxt.js livechat


    【解决方案1】:

    以下是如何将一些第 3 方脚本添加到您的 Nuxt 应用程序,具体取决于您确实需要的用例:https://stackoverflow.com/a/67535277/8816585

    ESlint 在这种代码 sn-p 上给你错误是完全正常的,你不需要关心这些。

    把它放在包含你的 sn-p 的 .js 文件的顶部(你不需要在这种文件中使用 linter)

    // eslint-disable
    

    【讨论】:

      猜你喜欢
      • 2013-05-31
      • 2021-12-05
      • 2020-03-02
      • 2019-11-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-11
      • 1970-01-01
      相关资源
      最近更新 更多