Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Vue.component('login-panel', {
  2. template: `
  3. <form action="">
  4. <div class="modal-card" style="width: auto">
  5. <header class="modal-card-head">
  6. <p class="modal-card-title">Login</p>
  7. </header>
  8. <section class="modal-card-body">
  9. <b-field>
  10. <b-input
  11. placeholder="User (Ohmportal)"
  12. :value="user"
  13. v-model=user
  14. required>
  15. </b-input>
  16. </b-field>
  17. <b-field>
  18. <b-input
  19. type="password"
  20. placeholder="Password"
  21. :value="pwd"
  22. required>
  23. </b-input>
  24. </b-field>
  25. <b-checkbox>Eingeloggt bleiben</b-checkbox>
  26. </section>
  27. <footer class="modal-card-foot">
  28. <button class="button" type="button" @click="$parent.close()">Close</button>
  29. <button class="button is-primary" @click="checkData()">Login</button>
  30. </footer>
  31. </div>
  32. </form>`,
  33. data: function () {
  34. return {
  35. user: "name",
  36. pwd:"password",
  37. };
  38. },
  39. methods: {
  40. checkData(){
  41. if(this.user === "name" && this.pwd === "password"){
  42. console.log("correct");
  43. }else{
  44. console.log("wrong");
  45. }
  46. },
  47. logIn(){
  48. $parent.close();
  49. },
  50. },
  51. });