I want to learn how to create a NUXT module from this template, which has the components and the store functionality built in.
# install dependencies
$ npm install
# serve with hot reload at localhost:3000
$ npm run dev
# build for production and launch server
$ npm run build
$ npm run start
# generate static project
$ npm run generateFor detailed explanation on how things work, check out Nuxt.js docs.
This module will depend on the following tools:
- Nuxt 2
- nuxt-vuex-localstorage
- Bootstrap but only in case of the CSS.
This template is packed with some tools for a faster workflow.
nuxt.config.js
- Every key in
cookieGroupsinconfig/cookieMessage.jsonwill be a group of services in the message. See the example to create new groups. This is needed for - Use the store service to execute code when something is enabled.
- see
privacy.vuefor related privacy informations
I tried to use the template and tutorial by Carepenny. My progress is quite okay! But how do I read and emit the store with the namespacing?
If I implement the store with namespacing as he does, how will the following lines be changed to make it work, without creating helper-plugins for everything?
$store.state.cookies.collapsed
this.$store.commit('cookies/saveSelection', newVal)
See cookieMessage.vue in nuxt-privacy-message
- Integrate example of google analytics initaliziation after it beeing allowed
- Wipe out CSS.
- Integrate Icons as SVGs not as webfont
- Should Bootstrap be delivered as dependency with the module? I guess the user should be free to use whatever other CSS?