LoginSignup
0
0

More than 1 year has passed since last update.

nuxt.jsでchatplusのscriptを適用させる

Posted at

chatplusはmoduleがないので全体に適用させるためにnuxt.config.jsに設定しなければいけなかった。

これ↓
スクリーンショット 2022-03-25 19.12.11.png

nuxt.config.js
const chat_script = `(function() {var w = window, d = document;
                var s = "https://app.chatplus.jp/cp.js";
                d["__cp_d"] = "https://app.chatplus.jp";
                d["__cp_c"] = "ID的なの";
                var a = d.createElement("script"),
                    m = d.getElementsByTagName("script")[0];
                a.async = true, a.src = s, m.parentNode.insertBefore(a, m);
              })();
            `;




    script: [
      {
        innerHTML: chat_script,
        body: true,
        hid: "chat-script",
        charset: "utf-8",
        async: true,
      },
     ]

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0