Skip to content

Vue Js Forms

VueJS Forms#


You can bind chekbox values to a single array field, just by binding to the same data field which is an arrray


Vue will recognise if they are bound to the same model field and will ensure only 1 is selected at a time


Populate a select and set a default

    <option v-for="priority in priorities" :select="priority == 'Medium'">{{ priority }}</option>

What does v-model actually do#


Is really just a shortcut for binding the value field and input events

    @input="x = $"

Creating our own form component#

2 THings are required

Needs to accept a value prop

and need to emit an input event

More Forms info at Vue