Skip to content

Dynamic properties in form #968

@bajki

Description

@bajki

Versions:

  • @inertiajs/inertia version: 0.10.1
  • @inertiajs/inertia-vue version: 0.7.2

Describe the problem:

Is there any way to add property to form if it's not defined on start?
Like this it won't post custom field.
Thanks

Steps to reproduce:

data() {
        return {
            sending: false,
            form: this.$inertia.form({
                name: "",
      })
};
},
methods: {
        submit() {
            this.sending = true;

            this.form.post(this.route("test"), {
                preserveScroll: true,
                onSuccess: () => (this.sending = false),
                onError: () => (this.sending = false)
            });
        }
}
mounted(){
  this.form.custom = "example".
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions