فهرست منبع

feat: Add `Tag` context to the method in plugin `addTab` (#8336)

Yingyi / 颖逸 2 سال پیش
والد
کامیت
73946e1b18
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      app/src/layout/dock/Custom.ts

+ 4 - 1
app/src/layout/dock/Custom.ts

@@ -4,6 +4,7 @@ import {App} from "../../index";
 
 export class Custom extends Model {
     public element: Element;
+    public tab: Tab;
     public data: any;
     public type: string;
     public init: () => void;
@@ -22,12 +23,14 @@ export class Custom extends Model {
         init: () => void
     }) {
         super({app: options.app, id: options.tab.id});
-        this.type = options.type;
         if (window.siyuan.config.fileTree.openFilesUseCurrentTab) {
             options.tab.headElement.classList.add("item--unupdate");
         }
+
         this.element = options.tab.panelElement;
+        this.tab = options.tab;
         this.data = options.data;
+        this.type = options.type;
         this.init = options.init;
         this.destroy = options.destroy;
         this.resize = options.resize;