NuxtJS Page Store
A page data store which clears itself down between pages using nuxt middleware. Useful for passing data from the page to the layout.
Installation
yarn add @netsells/nuxtjs-page-store
Usage
This module is built on top of Vuex for reactivity.
Add to your nuxt config:
modules: [
'@netsells/nuxtjs-page-store',
],
set
Set the data object, is merged with existing data
this$store
clear
Clear all the page data. Is called internally between pages
this$store;
getters
; name: 'my-layout' computed: ... ;
And in your template:
{{ get('title') }} {{ get('subtitle') }}