浏览代码

fix(electron): open in directory on Win

charlie 4 年之前
父节点
当前提交
dc4e9436d5
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      resources/js/preload.js

+ 5 - 1
resources/js/preload.js

@@ -55,7 +55,11 @@ contextBridge.exposeInMainWorld('apis', {
   },
 
   showItemInFolder (fullpath) {
-    shell.showItemInFolder(fullpath)
+    if (IS_WIN32) {
+      shell.openPath(path.dirname(fullpath))
+    } else {
+      shell.showItemInFolder(fullpath)
+    }
   },
 
   /**