Bootbox提示多行输入文本

kah*_*mlg 0 prompt bootbox

我想用多行提示创建一个启动箱。这是默认示例:

bootbox.prompt({
  title: "What is your real name?",
  value: "makeusabrew",
  callback: function(result) {
    if (result === null) {
      Example.show("Prompt dismissed");
    } else {
      Example.show("Hi <b>"+result+"</b>");
    }
  }
});
Run Code Online (Sandbox Code Playgroud)

但它只允许具有内联值。我需要显示多行值并输入多行文字。

kah*_*mlg 5

我只需要添加 inputType: "textarea"

bootbox.prompt({
  title: "What is your real name?",
  value: "makeusabrew",
  inputType: "textarea",
  callback: function(result) {
    if (result === null) {
      Example.show("Prompt dismissed");
    } else {
      Example.show("Hi <b>"+result+"</b>");
    }
  }
});
Run Code Online (Sandbox Code Playgroud)

现在它就像一种魅力:)