Skip to content

ArashiGrey/wp-nuxt

 
 

Repository files navigation

wp-nuxt

npm (scoped with tag) npm CircleCI Codecov Dependencies js-standard-style

📖 Release Notes

Features

The module adds WP-API to your nuxt application.

The size of the library is 85,5 kB minified (26,5 kB gzipped).

Setup

  • Add wp-nuxt dependency using yarn or npm to your project

  • Add wp-nuxt to modules section of nuxt.config.js

{
  modules: [
    // Simple usage
    'wp-nuxt',

    // With options
    ['wp-nuxt', {
      endpoint: 'https://wp.kmr.io/wp-json'
      /* other options of WP-API */
    }],
 ]
}

Usage

You can use the API of WP-API using the injected 'app.$wp'. (s. example)

Example

<script>
export default {
  async asyncData ({ app, store, params }) {
    return { articles: await app.$wp.posts().perPage(10) }
  }
}
</script>

License

MIT License

Copyright (c) yashha

About

The module adds WP-API to your nuxt application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 91.5%
  • Vue 8.5%