Caleb Denio
Caleb Denio

Reputation: 1675

How can I pull Vue Router pages from the server?

I'm building an Electron app that needs to have multiple pages. I've looked at Vue Router (I'm already using Vue) as a routing system, but I'd like to store every page a a separate HTML file.

I've tried a couple of things:

I'm open to using other routing systems, too. Vue Router just seemed the most convenient.

Thank you!

Upvotes: 2

Views: 121

Answers (1)

Tom Marienfeld
Tom Marienfeld

Reputation: 716

You could try out Nuxt.JS.

The big innovation of Nuxt.js comes with the nuxt generate command. When building your application, it will generate the HTML for every one of your routes and store it in a file.

For example, the following file structure:

-| pages/
----| about.vue
----| index.vue

Will generate:

-| dist/
----| about/
------| index.html
----| index.html

There is an Electron starter app with Nuxt on GitHub

Upvotes: 1

Related Questions