Write a small project of vue-electron casually

Because Baidu cloud disk is blocked in the company. . I used the QQ mailbox for a few meters to pass the message and there was no movement, so I wanted to write a small tool for uploading and downloading files by myself.

Initialization: vue-electron Chinese documentation  http://simulatedgreg.gitbooks.io/electron-vue/content/cn/ 

Writing: The structure of writing code is the same as writing a regular vue project, dividing axios into components one by one to obtain the data of the api interface (node ​​+ express used by my backend to add, delete, modify and check). When encountering cross-domain problems, node set the request permission. In electron, you can use the native module of node! I have tried exec to run the cmd command, but somehow the http module of node can't be used -- is it because I am using the wrong posture?

Packaging: You can directly package the exe by writing logic page code and playing npm run build. In package.json, you can set the packaged icon. In main index.js, you can set the size of the initialized window window. The installation process of packaging into a window is still under study. . I found a few plug-ins and obviously only 30M were packaged into 200M. . Too much

In the end, it's just a simple vue-electron window app written by a rookie. Haha (I always like to write some of my own small demos to play haha) Send an advertisement link github https://github.com/blilibili/code_warehouse If you try it out Please upload a small picture - - My server only has 2G. . .

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325269765&siteId=291194637