如何在消息中包含 Javascript 变量?
swal({ title: "Error!", text: "Javascript Variable?" type: "error", confirmButtonText: "Cool" });
var myVariable = 'Hello World';
swal({
title: "Error!",
text: myVariable,
type: "error",
confirmButtonText: "Cool"
});
@t4t5 @WeirdestYeti @zenflow在为文本分配变量后如何编辑文本的颜色?
@jsandleraol https://sweetalert.js.org/docs/#swal -text
最有用的评论
var myVariable = 'Hello World'; swal({ title: "Error!", text: myVariable, type: "error", confirmButtonText: "Cool" });