File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ export class LowCodeRoot extends Subscribe {
108108 // 根据屏幕大小计算出跟节点的font-size,用于rem样式的适配
109109 if ( this . isH5 ( ) ) {
110110 this . calcFontsize ( )
111- globalThis . removeEventListener ( 'resize' , this . calcFontsize ) ;
112- globalThis . addEventListener ( 'resize' , this . calcFontsize ) ;
111+ globalThis . removeEventListener ( 'resize' , this . calcFontsize . bind ( this ) ) ;
112+ globalThis . addEventListener ( 'resize' , this . calcFontsize . bind ( this ) ) ;
113113 }
114114 }
115115
@@ -177,6 +177,7 @@ export class LowCodeRoot extends Subscribe {
177177 }
178178
179179 private calcFontsize ( ) {
180+ console . log ( 'resize' )
180181 const { width } = document . documentElement . getBoundingClientRect ( ) ;
181182 const dpr = globalThis ?. devicePixelRatio || 1
182183 this . setBodyFontSize ( dpr ) ;
@@ -222,7 +223,7 @@ export class LowCodeRoot extends Subscribe {
222223 this . clear ( )
223224 this . page = undefined ;
224225 if ( this . isH5 ( ) ) {
225- globalThis . removeEventListener ( 'resize' , this . calcFontsize ) ;
226+ globalThis . removeEventListener ( 'resize' , this . calcFontsize . bind ( this ) ) ;
226227 }
227228 }
228229
You can’t perform that action at this time.
0 commit comments