gpt4 book ai didi

javascript - 删除焦点上的 SweetAlert 按钮轮廓

转载 作者:太空宇宙 更新时间:2023-11-03 21:24:59 25 4
gpt4 key购买 nike

我正在使用 SweetAlert在我的 nodeJS 元素上,它的工作就像一个魅力,除了当我显示确认模式时它将焦点设置到确认按钮并且它得到这个糟糕的轮廓。

事情是这样的: enter image description here

这就是我想要的样子: enter image description here

我已经尝试覆盖它的样式并将轮廓设置为无,但它没有用:

.sweet-alert button.confirm {
outline: none !important; }

我也尝试用这种风格摆脱任何轮廓:

*:focus, *:active {
outline: 0 !important; }

这是我用来触发 SweetAlert 模态的代码:

swal({ title: "Confirmation", 
text: "Are you sure you want to remove this credit card?",
showCancelButton: true,
confirmButtonText: "Yes, remove it",
closeOnConfirm: true },
doRemoveCard);

这是设置焦点的 sweetalert.min.js 中的一段代码:

a=o.querySelector("button.confirm");a.focus()

关于如何摆脱这个轮廓有什么想法吗?

最佳答案

你可以试试 sweetalert2 v7.x.x

.swal2-popup .swal2-styled:focus {
框阴影:无!重要;
}

关于javascript - 删除焦点上的 SweetAlert 按钮轮廓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33712204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com