mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(ssr): [tree-select] document is not defined (#17460)
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user