chrome浏览器去除密码框提示
import Vue from "vue";
Vue.directive("passward-disable-tips", {
bind: function (el, binding) {
const pwdTag = el.querySelector("input[type=password]");
if (pwdTag) {
pwdTag.setAttribute("readonly", "true");
pwdTag.addEventListener("focus", function () {
setTimeout(function () {
pwdTag.removeAttribute("readonly");
});
});
pwdTag.addEventListener("click", function () {
setTimeout(function () {
pwdTag.removeAttribute("readonly");
});
});
pwdTag.addEventListener("blur", function () {
pwdTag.setAttribute("readonly", "true");
});
}
}
});