fix window not defined

This commit is contained in:
pissang 2023-02-12 19:48:38 +08:00
parent 64af87bdce
commit 9b042bf9ff
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "claygl-next",
"version": "2.0.0-alpha.8",
"version": "2.0.0-alpha.9",
"description": "A 3D graphic library",
"keywords": [
"graphic",

View File

@ -143,7 +143,7 @@ interface OrbitControl
'autoRotate' | 'target' | 'distance' | 'orthographicSize' | 'alpha' | 'beta' | 'center'
> {}
const useTouchEvent = 'ontouchstart' in window;
const useTouchEvent = typeof window !== 'undefined' && 'ontouchstart' in window;
class OrbitControl extends Notifier {
disabled = false;