Each loop in vue js Hello all I'm new to vuejs, So I Want to know How can we do this in vuejs
$.each($(".input-check-association"), function(){
$(this).prop("disabled", false);
$(this).prop("checked", false);
});
What have you tried so far?
Also in vue you work with v-model where your input is connected to some data attribute.
Here is a small example of how you can disable a button in this case, but that's the same as an input: https://codepen.io/oomusou/pen/mVNVrL
@bobbybouwmann Thanks for your reply. I have multiple checkbox which are coming dynamically as shown below
@foreach($destinations as $destination)
<div class="input-check">
<input type="checkbox" id="{{$destination['id']}}" class="input-check-association check-{{$destination['id']}}" v-model="destination_check" value="{{$destination['id']}}">
<label for="{{$destination['id']}}">{{$destination['name']}}</label>
</div>
@endforeach
@v9 द They all have the same "v-model" name, that should be unique as well!
@bobbybouwmann if we provide unique v-mod to all checkboxs which are generated dynamically than, How we could manage these ? Please provide me some details if you could. Right now I'm using this as given below
data() {
return {
destination_check: [],
}
}
Please sign in or create an account to participate in this conversation.