Skip to content

Instantly share code, notes, and snippets.

@danielschmitz
Created February 17, 2018 14:55
Show Gist options
  • Save danielschmitz/0dcbfa4eb6bbcc4bd1c9399460afcbef to your computer and use it in GitHub Desktop.
Save danielschmitz/0dcbfa4eb6bbcc4bd1c9399460afcbef to your computer and use it in GitHub Desktop.
App consumindo o store.js
<template>
<div id="app">
<button @click="setFakeLogin()">Fake Login</button>
<button @click="setFakeLogout()">Fake Logout</button>
<router-view/>
</div>
</template>
<script>
import store from './store'
export default {
name: 'App',
data () {
return {
store
}
},
methods: {
setFakeLogin: function () {
this.store.username = 'daniel'
this.store.email = 'daniel@gmail.com'
this.store.token = 'hdudvo2837hfo2o38f93nknweoi209'
},
setFakeLogout: function () {
this.store.username = ''
this.store.email = ''
this.store.token = ''
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment