vue-cookie icon indicating copy to clipboard operation
vue-cookie copied to clipboard

Doesn't work without npm

Open IvRRimum opened this issue 8 years ago • 5 comments

Hey,

When i copy paste the build/vue-cookie.js to my own project and include below the vue.js include and try to call this.$cookie or Vue.cookie i get: Undefined get for undefined.

Does this work without npm?

IvRRimum avatar Mar 16 '17 17:03 IvRRimum

I also have this problem....

iReadX avatar Mar 27 '17 09:03 iReadX

What i did is just use tiny-cookie plugin directly. Without this wrapper. Works as a charm!

IvRRimum avatar Mar 27 '17 17:03 IvRRimum

yep, it's broken, I think in the build (the code in there in the source to do the right thing, and properly export)

khalwat avatar Mar 29 '17 02:03 khalwat

Try adding this code before your Vue code and after including tiny-cookie and Vue core's JS :

Vue.cookie = Cookie;
Vue.prototype.$cookie = Cookie;

kartsims avatar Apr 19 '17 09:04 kartsims

import Vue from 'vue';
import VueCookie from 'vue-cookie';

Vue.use(VueCookie);

iReadX avatar Jun 14 '18 02:06 iReadX