默认情况下,颜色是白色。是否可以改变sweetalert2的模态背景色?
我试着用CSS来改变它,就像我接着问这里和这里的另一个问题,如下所示:
.sweet-alert
{
background-color: #2f2f2f96;
}
但我什么都没有,
我使用甜警报问题功能
Swal.mixin({
input: 'text',
confirmButtonText: 'Next →',
showCancelButton: true,
progressSteps: ['1', '2', '3']
}).queue([
{
title: 'Question 1',
text: 'Chaining swal2 modals is easy'
},
'Question 2',
'Question 3'
]).then((result) => {
if (result.value) {
Swal.fire({
title: 'All done!',
html:
'Your answers: <pre><code>' +
JSON.stringify(result.value) +
'</code></pre>',
confirmButtonText: 'Lovely!'
})
}
})
我希望我能把模式颜色改成灰色。
发布于 2019-10-12 11:34:34
您必须在Swal函数中添加背景。它会对你有用的。
Swal.mixin({
input: "text",
confirmButtonText: "Next →",
showCancelButton: true,
background: 'gray',
progressSteps: ["1", "2", "3"]
})
.queue([
{
title: "Question 1",
text: "Chaining swal2 modals is easy"
},
"Question 2",
"Question 3"
])
.then(result => {
if (result.value) {
Swal.fire({
title: "All done!",
background: 'gray',
html:
"Your answers: <pre><code>" +
JSON.stringify(result.value) +
"</code></pre>",
confirmButtonText: "Lovely!"
});
}
});
https://stackoverflow.com/questions/58353497
复制相似问题