Created
November 9, 2020 06:31
-
-
Save blogcacanid/9f0b15f77d6a40ffe6ffa9e8e4fe3c0e to your computer and use it in GitHub Desktop.
Home.vue Authentication JWT Vue Lumen 7
This file contains 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="container"> | |
<header class="jumbotron"> | |
<h3>{{content}}</h3> | |
</header> | |
</div> | |
</template> | |
<script> | |
import UserService from '../services/user.service'; | |
export default { | |
name: 'Home', | |
data() { | |
return { | |
content: '' | |
}; | |
}, | |
mounted() { | |
UserService.getPublicContent().then( | |
response => { | |
this.content = response.data; | |
}, | |
error => { | |
this.content = | |
(error.response && error.response.data) || | |
error.message || | |
error.toString(); | |
} | |
); | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment