mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-30 00:23:38 +08:00
12 lines
252 B
TypeScript
12 lines
252 B
TypeScript
/**
|
||
*
|
||
* @description
|
||
* 判断是否可以操作 DOM。
|
||
*
|
||
* 如果可以操作 DOM,则返回 true,否则返回 false。
|
||
*/
|
||
const canUseDom = () =>
|
||
typeof window !== 'undefined' && !!window.document?.documentElement
|
||
|
||
export default canUseDom
|