@@ -106,21 +106,32 @@ export class Compiler implements ICompiler {
106106 this . _option ?. onError ?.( ...args ) ;
107107 } ) ;
108108 }
109+ const {
110+ performanceHook,
111+ autoRefreshDpr,
112+ dpr,
113+ mode,
114+ gestureConfig,
115+ interactive,
116+ clickInterval,
117+ autoPreventDefault,
118+ ...restOption
119+ } = this . _option ;
109120 this . _view = new View ( {
110121 width : this . _width ,
111122 height : this . _height ,
112123 container : this . _container . dom ?? null ,
113124 renderCanvas : this . _container . canvas ?? null ,
114- hooks : ( this . _option as any ) . performanceHook , // vgrammar 事件改造后,性能回调函数放在了hooks中实现
115- ...this . _option ,
116- autoRefresh : isValid ( this . _option . autoRefreshDpr ) ? this . _option . autoRefreshDpr : ! isValid ( this . _option . dpr ) ,
117- mode : toRenderMode ( this . _option . mode ) ,
125+ hooks : performanceHook , // vgrammar 事件改造后,性能回调函数放在了hooks中实现
126+ ...restOption ,
127+ autoRefresh : isValid ( autoRefreshDpr ) ? autoRefreshDpr : ! isValid ( dpr ) ,
128+ mode : toRenderMode ( mode ) ,
118129 autoFit : false ,
119130 eventConfig : {
120- gesture : isValid ( this . _option . gestureConfig )
121- ? ( this . _option . gestureConfig as any )
122- : isMobileLikeMode ( this . _option . mode ) ,
123- disable : this . _option . interactive === false
131+ gesture : isValid ( gestureConfig ) ? ( gestureConfig as any ) : isMobileLikeMode ( mode ) ,
132+ disable : interactive === false ,
133+ clickInterval ,
134+ autoPreventDefault
124135 } ,
125136 doLayout : ( ) => {
126137 this . _compileChart ?. onLayout ( this . _view ) ;
@@ -133,7 +144,6 @@ export class Compiler implements ICompiler {
133144 // emit afterRender event
134145 this . getStage ( ) . hooks . afterRender . tap ( 'chart-event' , this . handleStageRender ) ;
135146
136- const interactive = this . _option . interactive ;
137147 if ( interactive !== false ) {
138148 // 将 view 实例化之前监听的事件挂载到 view 上
139149 this . _viewListeners . forEach ( listener => {
0 commit comments