无法将文本粘贴到生产版本Sweetalert2中的模式弹出窗口中

时间:2019-04-10 06:45:06

标签: vue.js electron sweetalert2

我在vuejs / electron应用程序中使用sweetalert2作为模态。我可以在开发模式下将文本复制/粘贴到输入文本框中。但这不适用于生产环境。我不知道是什么问题?

以下是模式弹出窗口的代码:

  this.$swal({
    title: "<H4 style='color:#f48121'>AMS Keyword Search</H4>",
    html:
      "<p style='color:#FFFFFF'>Enter in a general keyword, phrase or book title, and KDP Rocket will find a large list of AMS keywords for you to use in your campaign <p>" +
      '<div style="bottom: -53px">' +
      '<div style="z-index: 100">' +
      '<select id="selected" class="swal-select">' +
      '<option value="book" data-foo="book">Book</option>' +
      '<option value="ebook" data-foo="e-book">E-Book</option></select>' +
      "</div>" +
      "</div>",
    input: "text",
    inputPlaceholder: "Type your keyword here",
    allowEnterKey: true,
    confirmButtonColor: "#f48121",
    background:   "#202d3e",
    reverseButtons: true,
    showCloseButton: true,
    showCancelButton: true,
    focusConfirm: false,
    confirmButtonText: "Go Get Em Rocket!",
    cancelButtonText: "Cancel!",
    closeOnConfirm: false,
    closeOnCancel: true,
    imageAlt: "AMS KEYWORD SEARCH",
    preConfirm: function(text) {
      return new Promise(function(resolve) {
        resolve([
          (amazonKeyword = text),
          (selectValue = document.getElementById("selected").value)
        ]);
            y = amazonKeyword.replace(/'/g, "")
      });
    }
  }).then(result => {
    if (result.value) {
      this.$router.push({
        name: "awsKeyword",
        params: { keyword: y, selectValue }
      });
    } else if (result.dismiss == "cancel") {
      console.log("cancel");
    }
  });

0 个答案:

没有答案