Created
February 17, 2018 15:13
-
-
Save danielschmitz/2ac39c96c6863e87f5a435d45a3e08e7 to your computer and use it in GitHub Desktop.
HelloWorld também consumindo o store
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 class="hello"> | |
<div v-if="store.isLogged()"> | |
Usuário Logado: {{store.username}} | |
</div> | |
<div v-else> | |
Ninguém logado | |
</div> | |
</div> | |
</template> | |
<script> | |
import store from '../store' | |
export default { | |
name: 'HelloWorld', | |
data () { | |
return { | |
store | |
} | |
} | |
} | |
</script> | |
<!-- Add "scoped" attribute to limit CSS to this component only --> | |
<style scoped> | |
div{ | |
padding:30px; | |
margin: 10px; | |
background: #def; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment