luoyifan před 3 roky
rodič
revize
6cb6dbca13
1 změnil soubory, kde provedl 12 přidání a 4 odebrání
  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();
         }