WordPress module for Nuxt.js with full support for SSR and Nuxt.js PWA module.

Related tags

Nuxt nuxt
Overview

Vue Wordpress Nuxt.js Module


WordPress module for Nuxt.js with full support for SSR and Nuxt.js PWA module.

More Info – https://nuxt.vuewordpress.io



Installation


Go to your app's main directory and run:

npm install @vue-wordpress/nuxt

or

yarn add @vue-wordpress/nuxt

Create Vuex Store in your application if it does not exist. You can do it by creating index.js file in store directory and put there content like:

export const state = () => ({

})

export const mutations = {

}

export const actions = {}

Open nuxt.config.js and add @vue-wordpress/core in modules section with additional configuration.

modules: [
  [
    '@vue-wordpress/core',
    {
      config: {
        url: 'https://wp.mysite.com/',
        lang: 'en'
      },
      store: 'manual',
      router: 'manual'
    }
  ]
]
Using top level options
modules: [
  '@vue-wordpress/nuxt'
],
wpJson: {
  config: {
    url: 'https://wp.mysite.com/',
    lang: 'en'
  },
  store: 'manual',
  router: 'manual'
}

As we cannot access Router and Store from nuxt.config.js we have to set it as 'manual'. The module will do the job and inject them other way.

As a last step we have to tell Nuxt to transpile the core module.

build: {
  transpile: ['@vue-wordpress/nuxt']
}

If you use any extension you just need to add it to the transpile array:

build: {
  transpile: ['@vue-wordpress/nuxt', '@vue-wordpress/acf']
}

That is all. Now you can use Vue Worpress module for Nuxt.js!



B. Vue.js


If you want to use this module with regular Vue.js, you can use core module used by this package available here: @vue-wordpress/core


C. Vue Storefront


If you want to use this module with Vue Storefront, we have created a dedicated package available here: @vue-wordpress/vsf


Usage


Pages


All you need to do to create new Page's route in your app is to create it in Wordpress Admin in Pages tab. It will automatiaclly be available under /page/<:page_slug> route.


Posts


The process is the same as above. You just need to create and publish new post in Wordpress Admin at Posts tab. It will automatiaclly be available under /post/<:post_slug> route.


Media


To be written.


Menus


To be able to use WordPress Menus in your app, you have to install additional plugin in your WordPress - WP-REST-API V2 Menus plugin. It extends native Wordpress REST API by adding a new endpoint with menus at /wp-json/menus/v1/menus/. After you have added the plugin @vue-wordpress/core will automatically detect and store your menus at:


store.state.wp_rest_content.menus[YOUR_MENU_SLUG]
this.$store.state.wp_rest_content.menus[YOUR_MENU_SLUG]

Advanced Usage


More information about additional features available with PRO version of module will be available here: https://vuejs.shop/modules/@vue-wordpress/core-pro


Additional modules (Coming soon)


Free Extensions



Yoast SEO Extension (Coming soon)


https://github.com/new-fantastic/@vue-wordpress/core-yoast


qTranslate Extension (Coming soon)


https://github.com/new-fantastic/@vue-wordpress/core-qtranslate-x


PRO Extensions



Advanced Custom Fields Extension (Coming soon)


https://vuejs.shop/modules/@vue-wordpress/core-acf


DIVI Page Builder Extension (planned for Fall 2019)


https://vuejs.shop/modules/@vue-wordpress/core-divi

You might also like...
This is nuxt invoice app using nuxt.js and firebase
This is nuxt invoice app using nuxt.js and firebase

Nuxt Invoice App Build Setup # install dependencies $ npm install # serve with hot reload at localhost:3000 $ npm run dev # build for production and

A lightweight Nuxt template to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.
A lightweight Nuxt template to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.

A lightweight Nuxt template to build a Markdown driven website. Powered by Nuxt Content, TailwindCSS and Iconify.

🖼Portfolio built with Nuxt and Nuxt Content

🖼Portfolio built with Nuxt and Nuxt Content

A convenient replacement for nuxt-link component when using nuxt-i18n

nuxt-i18n-link A convenient replacement for nuxt-link component when using nuxt-i18n. It is simply a replacement for this exact code: nuxt-link :to

A webpack loader i18n solution for Vue (Nuxt) with auto generated keysA webpack loader i18n solution for Vue (Nuxt) with auto generated keys

vue-i18n-loader - another webpack loader i18n solution for Vue (Nuxt) with auto generated keys. Currently under development, pull requests and suggest

A simple nuxt renderless component wrapper around nuxt fetch capabilities

Nuxt Fetch Component A simple nuxt renderless component wrapper around nuxt fetc

Nuxt basic - Simple Nuxt.js project

nuxt_basic Build Setup # install dependencies $ npm install # serve with hot reload at localhost:3000 $ npm run dev # build for production and launc

English-quiz-nuxt - An english quiz using nuxt

english-quiz-nuxt Live demo here Build Setup # install dependencies $ yarn insta

Frisque-nuxt-storyblok - A basic framework for integrating StoryBlok with Nuxt

🌺 Frisque StoryBlok Welcome to the Frisque StoryBlok starter kit! This is curre

Comments
  • When installing for NUXT just get an error screen.

    When installing for NUXT just get an error screen.

    I've ran through the process of installing the plugin for NUXT however just get an error screen when trying to access any routes. The wordpress API is working and confirmed. I've also tired both the auto and manual pages.

    https://paste.pics/f8945d07f975650d46c71e23fe91c5aa

    opened by joeycaughey 1
  • Security / Better path resolvers

    Security / Better path resolvers

    In Nuxt we cannot use Component's object directly. We have to provide a path to Vue component. In consequence of that, we need to make sure the resolved path always will be correct.

    Blocker Security 
    opened by Fifciu 0
Owner
Vue WordPress
Complete PWA solution for WordPress based on Vue.js
Vue WordPress
Fcl-nuxt-starter - FCL plugin + full stack Nuxt application starter template

How to use the Flow Client Library (FCL) with Nuxt Access the FCL instance from

Bruno Gonzales 3 Jul 18, 2022
Testing the SSR mode and additional features of Nuxt.js

nuxt-movie-app Build Setup # install dependencies

Turlubayev Marat 0 Dec 27, 2021
News App With Nuxt Js. SSR and SPA.

client Build Setup # install dependencies $ yarn install # serve with hot reload at localhost:3000 $ yarn dev # build for production and launch serv

Rido Ananda 0 Dec 25, 2021
nuxt-fullpage is a nuxt module for creating fullscreen page scroll fast and simple.

Nuxt fullpage Nuxt module for creating fullscreen page scroll fast and simple. Demo online Table of contents Installation Usage Options Contributing I

Open Source Afghanistan 16 Dec 30, 2022
Build a full-blown jamstack blog with Nuxt 3, Storyblok and Tailwind CSS demo repo

Nuxt 3 Minimal Starter Look at the nuxt 3 documentation to learn more. Setup Make sure to install the dependencies: # yarn yarn install # npm npm ins

Dawntraoz Storyblok 6 Nov 17, 2022
A template project for vue3, View UI Plus, Nuxt3, SSR, just install and run.

view-ui-project-nuxt A template project for vue3, View UI Plus, Nuxt3, SSR. Nuxt 3 Minimal Starter Look at the nuxt 3 documentation to learn more. Set

View Design 6 Dec 5, 2022
💫 Awesome module to generate PDF files and manage PDF inyour Nuxt application.

Generate PDF files directly from your content on your website, can be used for offline downloadable documentation pages.

Christian Hansen 47 Dec 27, 2022
💳 Adyen Payment Module for Nuxt.js

nuxt-adyen-module Adyen Module for Nuxt.js ?? Release Notes Setup Add nuxt-adyen-module dependency to your project yarn add nuxt-adyen-module # or npm

Jakub Andrzejewski 7 Dec 21, 2021
Nuxt module for fullpage.js library with official vue wrapper

nuxt-fullpage.js Nuxt module for fullpage.js library with official vue wrapper ?? Release Notes Setup Add nuxt-fullpage.js dependency using yarn or np

null 24 Jul 20, 2022
A module for nuxtjs that make define and use variables in component easier by use js object or json file.

nuxt-global-var A module for nuxtjs that make defining and using variables in component easier by using js object or json file. How to use Install Wit

Võ Hoàng Minh Chí 1 Nov 19, 2019