Created
February 17, 2018 14:55
-
-
Save danielschmitz/0dcbfa4eb6bbcc4bd1c9399460afcbef to your computer and use it in GitHub Desktop.
App consumindo o store.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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 = '[email protected]' | |
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