Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. <template>
  2. <v-container>
  3. <v-layout row wrap style="margin-top:200px">
  4. <v-flex xs-1 offset-sm-6>
  5. </v-flex>
  6. <v-flex xs-1 offset-sm-6>
  7. <h1>Sign up</h1>
  8. </v-flex>
  9. </v-layout>
  10. <v-layout row wrap mt-5>
  11. <v-flex xs-2>
  12. </v-flex>
  13. <v-flex xs-8>
  14. <v-form>
  15. <v-layout row>
  16. <v-flex xs-12 sm-8>
  17. <v-text-field
  18. name="username"
  19. label="Username"
  20. id="username"
  21. v-model="username"
  22. required
  23. ></v-text-field>
  24. </v-flex>
  25. </v-layout>
  26. <v-layout row mt-3>
  27. <v-flex xs-12 sm-8>
  28. <v-text-field
  29. name="password"
  30. label="Password"
  31. v-model="password"
  32. required
  33. ></v-text-field>
  34. </v-flex>
  35. </v-layout>
  36. <v-layout row mt-3>
  37. <v-flex xs-12 sm-8>
  38. <v-text-field
  39. name="name"
  40. label="Name"
  41. v-model="text"
  42. required
  43. ></v-text-field>
  44. </v-flex>
  45. </v-layout>
  46. <v-layout row mt-3>
  47. <v-flex xs-12 sm-8>
  48. <v-text-field
  49. name="studentid"
  50. label="Student ID"
  51. v-model="int"
  52. required
  53. ></v-text-field>
  54. </v-flex>
  55. </v-layout>
  56. <v-layout row warp mt-5>
  57. <v-flex>
  58. </v-flex>
  59. <v-flex xs-4>
  60. <v-btn class="primary" :disabled="!formisValidation">
  61. Sign In
  62. </v-btn>
  63. </v-flex>
  64. </v-layout>
  65. </v-form>
  66. </v-flex>
  67. <v-flex xs-2>
  68. </v-flex>
  69. </v-layout>
  70. </v-container>
  71. </template>
  72.  
  73. <script>
  74. export default {
  75. data () {
  76. return {
  77. username: '',
  78. password: '',
  79. name: '',
  80. studentid: ''
  81. }
  82. },
  83. computed: {
  84. formisValidation () {
  85. return this.username !== '' &&
  86. this.password !== ''
  87. }
  88. },
  89. methods: {
  90. logindata () {
  91. if (!this.formisValidation) {
  92. return
  93. }
  94. const logindata = {
  95. username: this.username,
  96. password: this.password
  97.  
  98. }
  99. this.$store.dispatch('login', logindata)
  100. this.$router.push('/')
  101. }
  102. }
  103. }
  104. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement