Skouter mortgage estimates. Web application with view written in PHP and Vue, but controller and models in Go.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

33 行
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>