Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <template>
  2. <div>
  3. <h1>TELA DE LOGIN</h1>
  4. <form method="post">
  5. <input type="text" v-model="form.username" placeholder="Usuário"> <br/>
  6. <input type="password" v-model="form.password" placeholder="*******">
  7. </form>
  8. <button v-on:click="login()">Logar</button>
  9. </div>
  10. </template>
  11. <script>
  12. import Service from '../libraries/service'
  13. export default {
  14. name: 'viewLogin',
  15. props: ['app'],
  16. data : function () {
  17. return {
  18. service: Service,
  19. auth: false,
  20. form : {
  21. username : '',
  22. password : '',
  23. }
  24. }
  25. },
  26. methods : {
  27. login : function () {
  28. Service.call('/auth/login', {}).get(function(res) {
  29. console.log(res);
  30. });
  31. this.app.login(true);
  32. }
  33. },
  34. watch: {
  35. auth: function (val) {
  36. console.log(val)
  37. }
  38. }
  39. }
  40. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement