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

Inertiajs forms support #220

Open
atymic opened this issue Aug 12, 2021 · 0 comments
Open

Inertiajs forms support #220

atymic opened this issue Aug 12, 2021 · 0 comments

Comments

@atymic
Copy link
Contributor

atymic commented Aug 12, 2021

Hey, not sure if it's outside the scope of this library, but it would be awesome to have a set of components for inertiajs forms

Happy to create a new lib if so, but something like this.
Anyone keen on this? Done a few components inside my app, but would be awesome to have it open source :)

<template>
  <form @submit.prevent="form.post('/login')">
    <!-- email -->
	<ti-input field="email" form="form" />
	<!-- password -->
	<ti-input field="email" form="form" />
    <input type="password" v-model="form.password">
    <div v-if="form.errors.password">{{ form.errors.password }}</div>
    
    <button type="submit" :disabled="form.processing">Login</button>
  </form>
</template>

<script>
import { useForm } from '@inertiajs/inertia-vue3'

export default {
  setup () {
    const form = useForm({
      email: null,
      password: null,
      remember: false,
    })

    return { form }
  },
}
</script>
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

1 participant