How to create single content page

So for anyone that was having similar issues, here is my solution to single pages.

My setup is nuxtjs, strapi, vultr with ubuntu 18.04

Install @nuxtjs/strapi plugin for nuxtjs

In your index.vue or whereever call for multiple content like all articles like this:

export default {

  async asyncData({ $strapi }) {

    return {

      articles: await $strapi.find("articles"),

    };

  },

}

and for a single page do:

export default {

async asyncData({ $strapi, params }) {

const matchingArticles = await $strapi.find("articles", {

  slug: params.slug,

});

return {

  article: matchingArticles[0]

};

},

data() {

return {

  apiUrl: process.env.strapiBaseUri,

};

},

}

also make sure you have a slug entity using UID for your strapi content type and use article.slug as the link in your index.vue or whatever .vue file.