Browse Source

fix(CollapsibleToolbar): 修复loadContentList未挂载到window的问题

将loadContentList方法挂载到window对象,确保外部可以调用
lsc 5 days ago
parent
commit
e3ec82a22a
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/components/CollapsibleToolbar/index.vue

+ 6 - 0
src/components/CollapsibleToolbar/index.vue

@@ -135,6 +135,8 @@ const toggleSubmenu = (menu: string) => {
   }
   }
 }
 }
 
 
+
+
 const handleToolClick = (tool: string) => {
 const handleToolClick = (tool: string) => {
   interface ParentWindowWithToolList extends Window {
   interface ParentWindowWithToolList extends Window {
     addTool?: (id: number) => void;
     addTool?: (id: number) => void;
@@ -177,6 +179,10 @@ const loadContentList = () => {
   }
   }
 }
 }
 
 
+(window as any).loadContentList = loadContentList
+
+
+
 const insertContent = (item: ContentItem) => {
 const insertContent = (item: ContentItem) => {
   if (!item.tool || !item.url) return
   if (!item.tool || !item.url) return
   createFrameElement(item.url, item.tool)
   createFrameElement(item.url, item.tool)