From 6adc0a6f814a980b22ea26cdb4da7112553e881b Mon Sep 17 00:00:00 2001 From: 2912401452 <2912401452@qq.com> Date: Wed, 10 Nov 2021 11:13:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=20l7utils=20image=20?= =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/utils/src/mini-adapter/register.ts | 42 ++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/utils/src/mini-adapter/register.ts b/packages/utils/src/mini-adapter/register.ts index 9a794cd3ba..72eb092c51 100644 --- a/packages/utils/src/mini-adapter/register.ts +++ b/packages/utils/src/mini-adapter/register.ts @@ -1,7 +1,7 @@ // @ts-nocheck // tslint:disable import devicePixelRatio from './devicePixelRatio'; -import { document } from './document'; +// import { document } from './document'; import * as Mixin from './util/mixin'; declare let my: any; @@ -29,18 +29,18 @@ function registerCanvas(c, id: string) { canvas.focus = function() {}; canvas.blur = function() {}; + // Tip: 小程序中无法动态注册事件 + // canvas.addEventListener = function(type, listener, options = {}) { + // document.addEventListener(type, listener, options); + // }; - canvas.addEventListener = function(type, listener, options = {}) { - document.addEventListener(type, listener, options); - }; + // canvas.removeEventListener = function(type, listener) { + // document.removeEventListener(type, listener); + // }; - canvas.removeEventListener = function(type, listener) { - document.removeEventListener(type, listener); - }; - - canvas.dispatchEvent = function(event: any) { - document.dispatchEvent(event); - }; + // canvas.dispatchEvent = function(event: any) { + // document.dispatchEvent(event); + // }; } // 异步注册2Dcanvas @@ -73,18 +73,18 @@ function registerCanvas2D(ctx, id: string) { }; canvas2D.focus = function() {}; canvas2D.blur = function() {}; + // Tip: 小程序中无法动态注册事件 + // canvas2D.addEventListener = function(type, listener, options = {}) { + // document.addEventListener(type, listener, options); + // }; - canvas2D.addEventListener = function(type, listener, options = {}) { - document.addEventListener(type, listener, options); - }; + // canvas2D.removeEventListener = function(type, listener) { + // document.removeEventListener(type, listener); + // }; - canvas2D.removeEventListener = function(type, listener) { - document.removeEventListener(type, listener); - }; - - canvas2D.dispatchEvent = function(event: any) { - document.dispatchEvent(event); - }; + // canvas2D.dispatchEvent = function(event: any) { + // document.dispatchEvent(event); + // }; } // 异步获取3Dcanvas