Advertisement
Guest User

Untitled

a guest
Sep 10th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <template>
  2. <div class="login-view layout-padding">
  3. <q-card class="bg-white card" inline>
  4. <q-card-title>
  5. <h3>Login</h3>
  6. <span slot="subtitle"></span>
  7. </q-card-title>
  8. <q-card-main>
  9. <form @submit.prevent="login">
  10. <q-input v-model="form.username" stack-label="Email" />
  11. <q-input v-model="form.password" stack-label="Password" />
  12. <q-btn type="submit" class="bg-primary text-white">Login</q-btn>
  13. </form>
  14. </q-card-main>
  15. </q-card>
  16. </div>
  17. </template>
  18. <script>
  19. import { QInput, QBtn, QCard, QCardTitle, QCardMain } from 'quasar'
  20. export default
  21. {
  22. data(){
  23. return {
  24. form : {
  25. username : null,
  26. password : null,
  27. }
  28. }
  29. },
  30. mounted(){
  31. console.log("Login view Loaded!")
  32. },
  33. methods : {
  34. async authenticate(){
  35. let username = this.form.username
  36. let password = this.form.password
  37. try{
  38. let authentication = await this.$oauth.login(username, password)
  39. //User logged
  40.  
  41. }
  42. catch(error){
  43. //Error in Login
  44. }
  45. }
  46. },
  47. components : {
  48. QInput,
  49. QBtn,
  50. QCard,
  51. QCardTitle,
  52. QCardMain
  53. }
  54. }
  55. </script>
  56. <style lang="scss">
  57. .login-view{
  58. display: flex;
  59. align-items: center;
  60. justify-content: center;
  61. height: 100vh;
  62. background-color: #898989;
  63. .card{
  64. padding: 24px;
  65. min-width: 300px;
  66. }
  67. form{
  68. max-width: 420px;
  69. }
  70. }
  71. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement