Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

registration.vue 641 B

1234567891011121314151617181920212223242526272829303132
  1. <template>
  2. <section class="shadowbox">
  3. <h2>Register</h2>
  4. <account :error="''" @submit="create" />
  5. </section>
  6. </template>
  7. <script setup>
  8. import { ref } from "vue"
  9. import Account from "./account.vue"
  10. function create(user) {
  11. console.log(user)
  12. fetch(`/api/user`,
  13. {method: 'POST',
  14. body: JSON.stringify(user),
  15. headers: {
  16. "Accept": "application/json",
  17. },
  18. }).then(resp => {
  19. console.log(resp)
  20. if (resp.ok) { return resp.json() } else { return resp.text() }
  21. }).then(u => console.log(u))
  22. }
  23. </script>
  24. <style scoped>
  25. section {
  26. max-width: 400px;
  27. margin: auto;
  28. }
  29. </style>