소스 검색

Ext.create

luoyifan 3 년 전
부모
커밋
6cb6dbca13
1개의 변경된 파일12개의 추가작업 그리고 4개의 파일을 삭제
  1. 12 4
      src/Scope.ts

+ 12 - 4
src/Scope.ts

@@ -113,11 +113,12 @@ export class Scope {
             data: {}
         }, that.model, dataOption)
 
-        this.viewModel = new Ext.app.ViewModel(vmodel);
-        this.viewModel.yvanScope = this
+        //this.viewModel = new Ext.app.ViewModel(vmodel);
+        //this.viewModel.yvanScope = this
 
         let config = _.defaultsDeep({
-                viewModel: this.viewModel,
+                // viewModel: this.viewModel,
+                viewModel: vmodel,
                 yvanScope: this,
                 referenceHolder: true,
 
@@ -171,7 +172,14 @@ export class Scope {
             }, config)
         }
 
-        that._handle = Ext.Viewport.add(config)
+        that._handle = Ext.create(config)
+
+        this.viewModel = that._handle.getViewModel()
+        this.viewModel.yvanScope = this
+
+        Ext.Viewport.add(that._handle)
+
+        // that._handle = Ext.Viewport.add(config)
         if (allowBack) {
             that._handle.show();
         }