Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use with Vue3 Compition Api #148

Open
ashikahmed-bd opened this issue May 29, 2023 · 1 comment
Open

Use with Vue3 Compition Api #148

ashikahmed-bd opened this issue May 29, 2023 · 1 comment

Comments

@ashikahmed-bd
Copy link

ashikahmed-bd commented May 29, 2023

<script setup>

import { reactive } from 'vue'
import Form from 'vform'

const form = reactive(new Form({
  phone: null,
  password: null,
}));

const onSubmit = async () => {
  const response = await axios.post('/api/login', form)
  console.log(response)
}

</script>
@dipoahmed018
Copy link

You need to provide the data instead of the full Form instance.

Use this instead
const response = await axios.post('/api/login', form.data())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants