alfhen / vue-cookie

A Vue.js plugin for manipulating cookies
MIT License
822 stars 74 forks source link

Doesn't work without npm #13

Open IvRRimum opened 7 years ago

IvRRimum commented 7 years ago

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?

iReadX commented 7 years ago

I also have this problem....

IvRRimum commented 7 years ago

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

khalwat commented 7 years ago

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

kartsims commented 7 years ago

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;
iReadX commented 6 years ago
import Vue from 'vue';
import VueCookie from 'vue-cookie';

Vue.use(VueCookie);