mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-12-01 17:23:40 +08:00
12 lines
268 B
TypeScript
12 lines
268 B
TypeScript
/**
|
||
*
|
||
* @description
|
||
* 获取当前环境是否为浏览器环境。
|
||
*
|
||
* 如果是浏览器环境,则返回 true,否则返回 false。
|
||
*/
|
||
const isBrowser = () =>
|
||
typeof window !== 'undefined' && !!window.document?.documentElement
|
||
|
||
export default isBrowser
|