I am new to Nuxt and trying to make a Single Product. I wonder:
- How is it possible to generate multiple pages in SSR and can create a new HTML for each page? Is CSR should be created first and then the SSR made or vice versa?
- If Vuex is used and a method dispatched in async Data is it possible to get data in computed? I mean is HTML generated dynamically if we get data in computed session? how should I use Vuex and be sure that every product certainly has its own HTML page?
Thank you
CodePudding user response:
- All pages created are generated SSR by default if the mode is set to SSR or Universal. First, files will be generated from the server and then injected into the client-side. You can avoid SSR in specific sections using the client-only tag. Nuxt pages Nuxt SSR
Q: Why should I use client-only?
A: Because it's possible when you use some dependencies, it returns undefined so we use client-only to render it on the client side and avoid this problem. - It is possible to use asyncData's value in components computed property. You're looking for dynamic routes (pages). You can access the information inside this using $route.
CodePudding user response:
@Amini thanks for your answer, It means that while using SSR and each HTML page is generated separately, need each page HTML info for the sake of SEO beacuse the metas are different for each page.