Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

33 rindas
641 B

  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>