alfhen / vue-cookie

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

How does this library differ from Veux State #26

Open acrolink opened 7 years ago

juanr2001 commented 6 years ago

@acrolink , as far as I know, Vuex State help you pass data more easily without bussing or creating properties or other ugly process that makes your code very unreadable and hard to follow. When you refresh that data you stored with Vuex gets reseted to the default value. vue-cookie goal is to help you store data that is needed to persist throughout the session. Other approach you can use without using the vue-cookie is to use the vue-resource and play with the urls, like: url/:id and when you refresh you can fetch that :id and do something with it.

I'm sorry if I give you the wrong information. This is my best answer I can provide you.

acrolink commented 6 years ago

@juanr2001 One limitation I had noticed with Vuex State is lack of data persistence on page navigation (between pages). As you said, using cookies solves that issue. So, would you recommend using this library to store say shopping cart items before checkout on a commerce site?