Skip to content

Instantly share code, notes, and snippets.

@danielschmitz
Created February 22, 2018 22:40
Show Gist options
  • Save danielschmitz/00ddbd0f950198f3ae328e1c6fc4d964 to your computer and use it in GitHub Desktop.
Save danielschmitz/00ddbd0f950198f3ae328e1c6fc4d964 to your computer and use it in GitHub Desktop.
Trabalhando com VueStash
<template>
<div id="app">
<button @click="setFakeLogin()">Fake Login</button>
<button @click="setFakeLogout()">Fake Logout</button>
<router-view/>
</div>
</template>
<script>
export default {
name: 'App',
store: ['username', 'email', 'token'],
methods: {
setFakeLogin: function () {
this.username = 'daniel'
this.email = 'daniel@gmail.com'
this.token = 'hdudvo2837hfo2o38f93nknweoi209'
},
setFakeLogout: function () {
this.username = ''
this.email = ''
this.token = ''
}
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment