Recently developed a H5 game, need an Excel to JSON tool, looked for online, did not find the right tool. Think of their own before with Nodejs, Express and Vuejs did a website, also used Ejsexcel plug-in, so I did a hands-on. Here is a simple record of the development process, to save yourself a souvenir.
This is the first blog in this series, starting with the new project.
1. Need to follow Nodejs and Vuejs
Installation of the method is not mentioned here, online looking for a lot of tutorials.
It's installed. You can look at the version numbers of Nodejs, Vuejs, and Express:
2. Use Vuejs to create a project with Webpack
Create command: Vue init webpack Developer_tools
The new process needs to fill in the author name, unit test and some configuration, on-demand selection is OK, this is what I created:
3. It is important to enter the project path and use the NPM install project dependencies
I'm used to using the shorthand command NPM i to install dependencies
Command: NPM I
The installation process will take several minutes. The installation is as follows:
4. Compiling the project using the NPM Run Build command
The compilation results are as follows:
5. Run the project using the NPM Run Start command
To run the command:
This will automatically open the Run Web page with the following content:
7. Generating a backend service framework using the Express generator generator
(1) Use command: Express Server introduces Express
After the execution:
(2) Enter the generated server directory and use the NPM I command to install Express dependencies
(3) To run Express and then access the 3000 port on this machine, you can see the Express page:
Run Express:
With a browser access to http://localhost:3000/#/, you can see the Express run page:
8. Installing the Ejsexcel module
Previously used Ejsexcel plugin, the function is very powerful. This is its Hithub address: https://github.com/sail-sail/ejsExcel
Install to the development directory, install the command: NPM i ejsexcel
Here, the entire project is created.
Using Nodejs, Ejsexcel, Express, Vuejs to write a tool for Excel to JSON--first step: Create a Vuejs project with Webpack