nuxt-community / adonuxt-template

[Deprecated] Starter template for Nuxt.js with AdonisJS.
451 stars 61 forks source link

How to call api for json data and show them in nuxt pages? #89

Open hkmsadek opened 6 years ago

hkmsadek commented 6 years ago

Please help me with at least the concept. I have two questions actually.

  1. How can I show data from an api end point? Let's say I have 10 products which I retrieve by calling a json end point. How can I show them in the .vue file?
  2. If I create a pagination with ajax (axios) and bring json data as more data, will the html out puts be shown in source code or a blank js as how we always see in a spa or ajax page. I mean how can I make a pagination where the html tags with data will be visible for better SEO?

Thank you. I am expecting at least some concept. Please pardon me I am very new to nuxt js. Thank you.

This question is available on Nuxt.js community (#c71)
khtodod commented 5 years ago

Hello , Did you solve it?

khtodod commented 5 years ago

Never mind , just put the routes before Route.any('*', 'NuxtController.render') ...