fix(ssr): [tree-select] document is not defined (#17460)

This commit is contained in:
qiang
2024-07-08 20:09:12 +08:00
committed by GitHub
parent eb5595457e
commit 6032af5405

View File

@@ -1,5 +1,6 @@
import { defineComponent, inject, watch } from 'vue'
import { selectKey } from '@element-plus/components/select'
import { isClient } from '@element-plus/utils'
import type { SelectContext } from '@element-plus/components/select'
import type { PropType } from 'vue'
@@ -33,6 +34,7 @@ export default defineComponent({
// fork from packages/select/src/useSelect.ts#330
const inputs = select.selectRef?.querySelectorAll('input') || []
if (
isClient &&
!Array.from(inputs).includes(
document.activeElement as HTMLInputElement
)