kViewerの明細画面に「印刷ボタン」を追加したい

お世話になっております。

トヨクモの友利と申します。

以下のコードで詳細画面に印刷ボタンを設置することができます。

(function() {

    "use strict";

    const pButton = document.createElement('button'); //ボタン生成
pButton.style.height = '30px'; //ボタンの高さ
pButton.style.width = '150px'; //ボタンの横幅
pButton.innerHTML = '印刷'; //ボタンの表示名
pButton.style.borderRadius = '10px'; //ボタンのデザイン
pButton.onclick = function() {
window.print();
};

kv.events.view.detail.mounted.push(function (state) {
       document.querySelector('.content').appendChild(pButton);
  });

})();