#vue# #前端#
const removeAllFocus() {
// 使用document.querySelectorAll选择所有可聚焦的元素
const focusableElements = [
'[contenteditable]',
'a[href]', 'area[href]', 'button:not([disabled])', 'input:not([disabled]):not([type="hidden"]):not(.no-focus)', 'select:not([disabled])', 'textarea:not([disabled])',
'iframe', 'object', 'embed', '[tabindex]:not([tabindex="-1"]):not([disabled])', '[contenteditable]'
].join(',');
const allFocusableElements = document.querySelectorAll(focusableElements);
// 遍历所有元素并移除聚焦
allFocusableElements.forEach(element => {
element.blur();
});
}