Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <!-- Para ficar mais limpo, estou usando Pug nos exemplos. -->
  2. <template lang="pug">
  3. form(v-on:submit.prevent="submitForm()")
  4. input(type="text" v-model="user.name" name="name" placeholder="Nome do Usuário")
  5. input(type="email" v-model="user.email" name="email" placeholder="Email do Usuário")
  6. input(type="password" v-model="user.password" name="password" placeholder="Senha do Usuário")
  7. button.button(type="submit") Salvar
  8. </template>
  9.  
  10. <script>
  11. export default {
  12. name: 'userForm',
  13. props: {
  14. user: {
  15. required: false,
  16. default: () => {
  17. return {
  18. name: '',
  19. email: '',
  20. password: ''
  21. }
  22. }
  23. }
  24. },
  25. methods: {
  26. submitForm () {
  27. this.$emit('submit', this.user)
  28. }
  29. }
  30. }
  31. </script>
  32.  
  33. <style scoped>
  34. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement