chore: ios 的 DragEvent 报错修复挪到 core 模块下 (#7154)

* chore: ios 的 DragEvent 报错修复挪到主项目中

* chore: ios 的 DragEvent 报错修复挪到 core 模块下
This commit is contained in:
吴多益 2023-06-15 11:36:29 +08:00 committed by GitHub
parent 85810fea45
commit a4f877587c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View File

@ -18,10 +18,3 @@ import 'core-js/es/symbol';
import './cloest';
// @ts-ignore
import './classList';
// ios 没有这个会报错
if (!('DragEvent' in window)) {
Object.defineProperty(window, 'DragEvent', {
value: class DragEvent {}
});
}

View File

@ -22,6 +22,7 @@ import {
extendDefaultEnv
} from './factory';
import type {RenderOptions, RendererConfig, RendererProps} from './factory';
import './polyfills';
import './renderers/builtin';
import './renderers/register';
export * from './utils/index';

View File

@ -0,0 +1,10 @@
/**
* polyfill
*/
// ios 老版本没有这个会报错
if (!('DragEvent' in window)) {
Object.defineProperty(window, 'DragEvent', {
value: class DragEvent {}
});
}