Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why plugin? #14

Closed
jiv-e opened this issue Apr 4, 2017 · 4 comments
Closed

Why plugin? #14

jiv-e opened this issue Apr 4, 2017 · 4 comments

Comments

@jiv-e
Copy link

jiv-e commented Apr 4, 2017

I find this project interesting. Can you explain why not to use tiny-cookie directly? What are the benefits of using Vue plugin?

It would be great if the answers could be added to the README.

@janat08
Copy link

janat08 commented Apr 9, 2017

I guess to render cookies or use them in template tags, since it doesn't appear to have global scope or what.

@jiv-e
Copy link
Author

jiv-e commented Apr 9, 2017

Why not import tiny-cookie directly to your component where needed like this?

<script>
  import cookie from 'tiny-cookie'

  export default {
    name: 'my-component',
    methods: {
      setCookie() {
        cookie.set('test', 'Hello world!', 1);
      },
    ...

@janat08
Copy link

janat08 commented Apr 9, 2017

try {{cookie.get}}...

@jiv-e
Copy link
Author

jiv-e commented Apr 9, 2017

Ok! I get it now! It would be helpful to describe this use case in the README.

@jiv-e jiv-e closed this as completed Apr 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants