L
L
lleballex2021-03-26 10:29:13
Vue.js
lleballex, 2021-03-26 10:29:13

How to render pages in Vue.js?

I have a project where the frontend is Vue.js and the backend is Django Rest Framework . And now I'm pre-rendering by adding this code:

const path = require('path')
const PrerenderSPAPlugin = require('prerender-spa-plugin')

module.exports = {
  configureWebpack: {
    plugins: [
      new PrerenderSPAPlugin({
        staticDir: path.join(__dirname, 'dist'),
        routes: ['/', '/login', '/register', '/about']
      })
    ]
  }
}

It all works. But I still have post pages ( /posts/:id ). That is, posts are constantly added, and their id is used in the url. I understand that PrerenderSPAPlugin will not help here. How can I render these pages?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WapSter, 2021-03-26
@wapster92

How to render pages in Vue.js?
the question does not sound correct, since vue renders pages anyway - this is its main task. Use nuxt and don't mess around with undeveloped plugins if you're making a complex application

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question