adonuxt-template icon indicating copy to clipboard operation
adonuxt-template copied to clipboard

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

Open hkmsadek opened this issue 7 years ago • 2 comments

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)

hkmsadek avatar Feb 22 '18 19:02 hkmsadek

Hello , Did you solve it?

khtodod avatar Mar 21 '19 02:03 khtodod

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

khtodod avatar Mar 21 '19 02:03 khtodod