Przeglądaj źródła

支持ctl 弹窗跳转

visuddhinanda 2 lat temu
rodzic
commit
7543bdc050
1 zmienionych plików z 7 dodań i 4 usunięć
  1. 7 4
      dashboard/src/components/article/TypeArticle.tsx

+ 7 - 4
dashboard/src/components/article/TypeArticle.tsx

@@ -106,10 +106,13 @@ const TypeArticleWidget = ({
                   level: item.level,
                 };
               })}
-              onSelect={(keys: string[]) => {
-                console.log(keys);
-                if (typeof onArticleChange !== "undefined" && keys.length > 0) {
-                  onArticleChange("article", keys[0]);
+              onClick={(
+                id: string,
+                e: React.MouseEvent<HTMLSpanElement, MouseEvent>
+              ) => {
+                const target = e.ctrlKey || e.metaKey ? "_blank" : "self";
+                if (typeof onArticleChange !== "undefined") {
+                  onArticleChange("article", id, target);
                 }
               }}
             />