我希望在vuejs2中获得select选项的当前值。
我有个拉拉刀片代码:
<select class='form-control units' @change='units' name='items_quantity_unit_id[]' required>
@foreach($units as $unit)
<option class='form-control' value='{{$unit["id"]}}'>{{$unit['unit_name']}}</option>
@endforeach
</select>我有这个vuejs2代码
units:function(){
var unit_id = $(this).val();
console.log(unit_id);
}现在,当我更改select选项时,我得到了以下错误:
ncaught TypeError: Cannot read property 'toLowerCase' of undefined因此,当我在vuejs2中更改选项时,如何获得该值。
谢谢
https://stackoverflow.com/questions/53029411
复制相似问题