Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <template id="mytemplate">
  2. <div>
  3. <form @submit.prevent="onFormSubmit">
  4. username <input v-model="username" />
  5. password <input v-model="password" />
  6. <button type="submit">Login</button>
  7. </form>
  8. </div>
  9. </template>
  10.  
  11.  
  12. kiwi.plugin('my_plugin', function(kiwi) {
  13. kiwi.addView('myloginview', {
  14. template: '#mytemplate',
  15. data: function() {
  16. return {
  17. username: '',
  18. password: '',
  19. };
  20. },
  21. methods: {
  22. onFormSubmit: function(event) {
  23. var network = kiwi.state.getActiveNetwork();
  24. // ... do login stuff here
  25. },
  26. },
  27. });
  28.  
  29.  
  30. // when something happens then do this
  31. function showLoginForm() {
  32. kiwi.showView('myloginview');
  33. }
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement