Преглед изворни кода

showPage / showDialog / renderTo

luoyifan пре 4 година
родитељ
комит
2e6e40876d
2 измењених фајлова са 3 додато и 9 уклоњено
  1. 1 6
      src/Scope.ts
  2. 2 3
      src/controls/MainTab.js

+ 1 - 6
src/Scope.ts

@@ -9,11 +9,6 @@ export class Scope {
     id = _.uniqueId('scope_')
 
     /**
-     * 模块文件路径(可以为空)
-     */
-    path
-
-    /**
      * 一个 ExtJS 能接受的配置对象
      */
     vjson
@@ -34,7 +29,7 @@ export class Scope {
     _handle
 
     /**
-     * 与 Watch 装饰器配合使用.
+     * 与 watch 装饰器配合使用.
      * viewModel 属性更改时触发成员方法
      */
     _watchList

+ 2 - 3
src/controls/MainTab.js

@@ -38,11 +38,11 @@ export default function () {
          * @param config ExtJS配置对象
          */
         addScope(scopeInstance, config) {
-            if (scopeInstance.path) {
+            if (config.path) {
                 for (let i = 0; i < this.items.items.length; i++) {
                     // 找到当前 tabs 里有没有已经打开过
                     const tab = this.items.items[i]
-                    if (_.isEqual(tab.uuid, scopeInstance.path)) {
+                    if (_.isEqual(tab.path, config.path)) {
                         // 激活
                         this.setActiveTab(tab);
                         return
@@ -52,7 +52,6 @@ export default function () {
 
             // 添加业务模块
             this.add({
-                uuid: scopeInstance.path,
                 closable: true,
                 ...config,
             })