Vuejs Form Input Bindings – vuejs form component-Vuejs-Form

Vuejs Form Input Bindings – vuejs form component-Vuejs-Form

we can use the data-bindning use v-model directive to simple create two-way data bindings means live changes on form input elements and textarea elements.Handling Forms using Vuejs

Include Script

<a href="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js">https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js</a>

Form Input Bindings – Text using Vuejs

<p>result is: {{ result }}</p>

Form Input Bindings – Multiline text using vuejs

<span>Multiline result is:</span>
<p>{{ result }}</p>
<br>
<textarea></textarea>

Form Input Bindings – Checkbox

Simple Single checkbox, and boolean value:

<label for="checkbox">{{ labelcheck }}</label>

Form Input Bindings – Multiple checkboxes using vuejs, bound to the same Array:

<label for="Dsp">Dsp</label>

<label for="sweetu">sweetu</label>

<label for="free">free</label>
<br>
<span>labelcheck names: {{ liveBoxName }}</span>

Script.js

new Vue({
  el: '...',
  data: {
    liveBoxName: []
  }
})

Form Input Bindings – Radio using Vuejs

<label for="first">first</label>
<br>

<label for="second">second</label>
<br>
<span>datapik: {{ datapik }}</span>

Form Input Bindings – Select using Vuejs

  Please Option select first
  Item A
  Item B
  Item C

<span>dataselect: {{ dataselect }}</span>

Script
new Vue({
  el: '...',
  data: {
    dataselect: ''
  }
})

Form Input Bindings – Multiple select using Vuejs (bound to Array):

  A
  B
  C

<br>
<span>dataselect: {{ dataselect }}</span>

Form Input Bindings – Value Bindings

<!-- `datapik` is a string "a" when labelcheck -->

<!-- `toggleclass` is either true or false -->

<!-- `dataselect` is a string "xyz" when dataselect -->

  xyz

Example

READ :  Angular Filter Nested JSON Hierarchical Treeview in Controller

Example

Leave a Reply

Your email address will not be published. Required fields are marked *