implementation

1. Add template files

Add the template file to the public folder

Such as: / public/demo. HTML

Template files can also be placed directly in a folder under Pages

Such as: the SRC/pages/demo2 / demo2. HTML

Use pages of VUE-CLI3

2. Create the vue.config.js file

3. Configure the Pages field

Module.exports = {pages: {index: {entry: 'SRC /main.js', // page entry: 'public/index.html', // template source filename: 'index.html', // output in dist/index.html}, demo: {entry: 'SRC /pages/demo/main.js', template: 'public/demo.html', filename: 'demo.html', }, demo2: { entry: 'src/pages/demo2/main.js', template: 'src/pages/demo2/demo2.html', filename: 'demo2.html', }, } }Copy the code

For details, see vue-CLI official documentation

Create a folder under SRC

src/pages/demo

src/pages/demo2

Each subcontractor configures its own separate routing and entry files

5. Local development and access

npm run serve

http://localhost:8080/demo

http://localhost:8080/test

http://localhost:8080/demo2

6. Migrate existing services

The views folder is established under the Pages folder, and relevant businesses can be directly migrated. Of course, specific projects can be dealt with, and some routes that have changes can be controlled and modified in details by themselves

Results and data support

no

other

The source code