formers/former

How to use vuejs directives with former

dhsont opened this issue · 2 comments

Hi, i want to use vuejs with former.

But i am not able to add vuejs directives in fields with former.

I want to achieve this

<select v-on:change="myMethod(this)" v-model="selecteduser" class="form-control" name="user_id"> 
    <option value="" selected="selected">Select  User</option>
    <option value="1">John</option>
    <option value="2">Tom</option>
</select>

I can achieve this using laravel collective form using following code

  {!!  Form::select('user_id', $users, null,  ['v-on:change'=>'myMethod(this)','v-model'=>'selecteduser','class'=>'form-control'])  !!}

I don't know how to achieve this with Former.

Is there anyone can help me with this.

Ah i got solution.

there is method setAttribute().
we can use like

->setAttribute('v-on:change', 'myMethod(this)')->setAttribute('v-model', 'selecteduser')

Thanks for this very useful package.
I am using this package from last 3-4 years, and i can't imaging laravel forms without this package.

I was looking for this too tell you, glad too see you found it yourself too 👌