Skip to content
/ form Public

Extracted useForm from InertiaJS to make form handling faster

License

Notifications You must be signed in to change notification settings

osenco/form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Form

Extracted useForm from InertiaJS to make form handling faster

Installation

pnpm add @osenco/form

Usage

VueJS

<script lang="ts" setup>
import { useForm } from "@osenco/form"

const form = useForm({
    name: '',
    email: ''
})

const submitForm = async () => {
    const { id } = await form.post('/users', {
        auth: `Bearer ${token}`
    })
}
</script>

<template>
    <form @submit.prevent="submitForm">
        <label>
            Name
            <input v-model="form.name" type="name" />
        </label>
        
        <label>
            Email
            <input v-model="form.email" type="email" />
        </label>

        <input type="submit" value="Save details" :disabled="form.processing" />
    </form>
</template>

About

Extracted useForm from InertiaJS to make form handling faster

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published