@vue-wordpress/nuxt
Advanced tools
Comparing version 1.0.12 to 1.1.0
13
index.js
import path from 'path' | ||
import { routes } from '@vue-wordpress/core/router/routes' | ||
@@ -18,14 +17,2 @@ export default async function nuxtBootstrapVue (moduleOptions) { | ||
if(config.router === true) { | ||
const r = routes(true) | ||
this.nuxt.options.router.extendRoutes = (nuxtRoutes, resolve) => { | ||
nuxtRoutes.push(...r.map((route) => { | ||
let cmp = route.component.replace('../', 'node_modules/@vue-wordpress/core/') | ||
return { ...route, component: resolve(cmp) } | ||
})) | ||
} | ||
} | ||
} |
{ | ||
"name": "@vue-wordpress/nuxt", | ||
"version": "1.0.12", | ||
"version": "1.1.0", | ||
"description": "💫 Wordpress REST API plugin for Nuxt.js with out-of-box routing and data handling 💫", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
import Vue from 'vue' | ||
import WpJson from '@vue-wordpress/core' | ||
import * as vuex from '@vue-wordpress/core/plugin/initializers/store' | ||
import registerPlugin from '@vue-wordpress/core/plugin/registerPlugin' | ||
@@ -11,24 +10,16 @@ export default async (ctx, inject) => { | ||
Vue.use(WpJson, { | ||
...options, | ||
plugins: [] | ||
}) | ||
Vue.use(WpJson, options) | ||
if (options.plugins) { | ||
if(Array.isArray(options.plugins)) { | ||
for (let plugin of options.plugins) { | ||
registerPlugin(Vue, plugin, ctx.store) | ||
} | ||
} else if (typeof options.plugins === 'string') { | ||
registerPlugin(Vue, options.plugins, ctx.store) | ||
} | ||
} | ||
await vuex.loadBase(ctx.store.dispatch, options.menus) // menus | ||
vuex.setConfig(ctx.store.commit, { | ||
...options, | ||
url: options.url, | ||
lang: options.lang, | ||
...(options.requestPrefix ? { requestPrefix: options.requestPrefix } : {}), | ||
...(options.menus ? { menus: options.menus } : {}), | ||
...(options.titleTemplate ? { titleTemplate: options.titleTemplate } : {}), | ||
...(options.debugger ? { debugger: options.debugger } : {}), | ||
asyncData: true | ||
}) | ||
await vuex.loadBase(ctx.store.dispatch, options.hasOwnProperty("menus") ? options.menus : true) // menus | ||
} |
Copyleft License
License(Experimental) Copyleft license information was found
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found
Found 1 instance in 1 package
0
7137
31