fix: 点击空白区域报错

This commit is contained in:
dap 2024-08-08 08:21:11 +08:00
parent f2f7225c1f
commit b78f3c8fa0

View File

@ -35,9 +35,9 @@ const sortableInstance = ref<null | Sortable>(null);
// domtab // domtab
function findParentElement(element: HTMLElement) { function findParentElement(element: HTMLElement) {
const parentCls = 'group'; const parentCls = 'group';
return element.classList.contains(parentCls) return element?.classList?.contains(parentCls)
? element ? element
: element.closest(`.${parentCls}`); : element?.closest(`.${parentCls}`);
} }
async function initTabsSortable() { async function initTabsSortable() {