Wordpress REST API module for Vue Storefront providing an out-of-box routing and data handling.
Go to your theme's main directory and run:
npm install @vue-wordpress/core
or
yarn add @vue-wordpress/core
Go to your vue-storefront
's modules
catalog and clone the repository with the module.
cd ../vue-storefront/src/modules;
git submodule add https://github.com/new-fantastic/vsf-wp-json.git;
This will create a Git Submodule for your vue-storefront
repository. Thanks to that you will be able pull for new updates :)
After that, add module to modules/index.js:
import { WpJson } from './vsf-wp-json'
//...
export const registerModules: VueStorefrontModule[] = [
// ...
WpJson,
// ...
]
Open config file, then at the end of main object add:
"wordpressCms": {
"url": "https://your-wordpress-url.com/",
"lang": "en",
"menus": ["for-buyers", "footer"]
}
If you want to register plugin, you can do it by adding in wordpressCms
- plugins, e.g.:
"wordpressCms": {
"url": "https://your-wordpress-url.com/",
"lang": "en",
"menus": ["for-buyers", "footer"],
"plugins": "acf"
}
Plugins should be inside node_modules/@vue-wordpress
. They also should have vue-wp-json
prefix.