fix: 点击空白区域报错
This commit is contained in:
parent
f2f7225c1f
commit
b78f3c8fa0
@ -35,9 +35,9 @@ const sortableInstance = ref<null | Sortable>(null);
|
|||||||
// 可能会找到拖拽的子元素,这里需要确保拖拽的dom时tab元素
|
// 可能会找到拖拽的子元素,这里需要确保拖拽的dom时tab元素
|
||||||
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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user