Browse Source

添加窗口退出

xushining 3 years ago
parent
commit
e29f53a379
2 changed files with 7 additions and 1 deletions
  1. 2 1
      src/components/TitleBar.vue
  2. 5 0
      vue.config.js

+ 2 - 1
src/components/TitleBar.vue

@@ -234,7 +234,8 @@ export default {
       done();
     },
     mainClose() {
-      //remote.getCurrentWindow().close();
+      const {remote} = require('electron');
+      remote.getCurrentWindow().destroy();
     }
   }
 };

+ 5 - 0
vue.config.js

@@ -1,5 +1,10 @@
 module.exports = {
     configureWebpack: {
       devtool: 'source-map'
+    },
+    pluginOptions:{
+      electronBuilder:{
+        nodeIntegration:true
+      }
     }
   }