Closed gabrielmancini closed 7 years ago
@gabrielmancini I haven't used Nuxt before and thus does not know what the problems are, but if you are willing to make a fork with a test branch where you set up Nuxt and vue-cookie then I am happy to take a look at it.
its working now :-)
@gabrielmancini Okay, I am glad you got it working 👍
@gabrielmancini what did you do? I have undefined on this.$cookie
object, i'm using Nuxt too.
src/plugins/vue-cookie.js
import Vue from 'vue';
import VueCookie from 'vue-cookie';
Vue.use(VueCookie);
const cookie = VueCookie;
export default cookie;
nuxt.config.js
{
...
plugins: [
{src: '~plugins/vue-strap', ssr: false},
{src: '~plugins/vue-i18n', ssr: false},
{src: '~plugins/vue-cookie', ssr: false, injectAs: 'cookie'}
],
...
How about without nuxt?
my working /plugins/vue-cookie.js
file is:
import Vue from 'vue'
import VueCookie from 'vue-cookie'
Vue.use(VueCookie)
export default function ({ app }, inject) {
inject('cookie', VueCookie)
}
nuxt@2.2.0 vue-cookie@1.1.4
with nuxt middleware support ?
not work here ;-(